-
-
Notifications
You must be signed in to change notification settings - Fork 118
56 lines (53 loc) · 2.13 KB
/
update-conda-lockfile.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
---
name: update-conda-lockfile
on:
workflow_dispatch:
schedule:
- cron: "0 9 * * 1" # Mondays at 9AM UTC
# What branch does this action run on?
# - workflow_dispatch: Whatever branch it was run against.
# - schedule: Always runs on main
jobs:
update-conda-lockfile:
runs-on: ubuntu-latest
if: ${{ (github.event_name == 'schedule' && github.repository == 'catalyst-cooperative/pudl') || (github.event_name == 'workflow_dispatch') }}
defaults:
run:
shell: bash -l {0}
steps:
- name: Get today's date
run: |
echo "TODAY=$(date +%Y-%m-%d)" >> $GITHUB_ENV
- uses: actions/checkout@v4
with:
token: ${{ secrets.PUDL_BOT_PAT }}
- name: Install Micromamba
uses: mamba-org/setup-micromamba@v2
with:
environment-name: conda-lock
create-args: >-
python=3.12
conda-lock>=2.5.7
prettier
- name: Run conda-lock to recreate lockfile from scratch
run: |
make conda-clean
make conda-lock.yml
- name: Make a PR to merge updated conda lockfiles
# If we are relocking dependencies on a schedule or workflow_dispatch, we need
# to make our own PR to check whether the updated environment actually solves
# and the tests pass.
if: ${{ (github.event_name == 'schedule' && github.repository == 'catalyst-cooperative/pudl') || (github.event_name == 'workflow_dispatch') }}
uses: peter-evans/create-pull-request@v7
with:
token: ${{ secrets.PUDL_BOT_PAT }}
commit-message: "Update conda-lock.yml and rendered conda environment files."
title: Update conda lockfile for week of ${{ env.TODAY }}
body: >
This pull request relocks the dependencies with conda-lock.
It is triggered by [update-conda-lockfile](https://github.com/catalyst-cooperative/pudl/blob/main/.github/workflows/update-conda-lockfile.yml).
labels: dependencies, conda-lock
reviewers: zaneselvans
branch: update-conda-lockfile
base: ${{ github.ref_name }}
delete-branch: true