-
Notifications
You must be signed in to change notification settings - Fork 713
87 lines (76 loc) · 2.48 KB
/
wave.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
name: Generate conda-lock
# When environment.yml is changed
on:
pull_request:
paths:
- "**/environment.yml"
jobs:
gen-matrix:
name: generate-matrix
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4
- name: Calculate file differences
id: diff
uses: tj-actions/changed-files@v44
with:
json: true
quotepath: false
files: |
modules/**/environment.yml
- name: Debug
run: echo ${{ steps.diff.outputs.all_changed_files }}
- id: set-matrix
run: echo "matrix={\"files\":${{ steps.diff.outputs.all_changed_files }} }" >> "$GITHUB_OUTPUT"
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
lock:
if: "${{ fromJson(needs.gen-matrix.outputs.matrix) }}"
needs: gen-matrix
name: Generate conda-lock file
permissions:
contents: write
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix: "${{ fromJson(needs.gen-matrix.outputs.matrix) }}"
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4
with:
ref: ${{ github.event.pull_request.head.ref }}
- uses: mamba-org/setup-micromamba@v1
with:
environment-name: conda-lock-env
create-args: >-
python=3.11
conda-lock
mamba
- name: Get the lock file path
uses: actions/github-script@v7
id: lockfile-name
with:
result-encoding: string
script: |
return '${{ matrix.files }}'.replace('/environment.yml', '/conda-lock.yml');
- name: Run conda-lock
run: |
rm --force "${{steps.lockfile-name.outputs.result}}"
conda-lock lock $MAMBA --file "${{ matrix.files }}" --kind lock --platform linux-64 --lockfile "${{steps.lockfile-name.outputs.result}}"
env:
MAMBA: "--mamba"
shell: bash -l {0}
- name: Commit & push changes
id: commit-and-push
run: |
git config user.email "[email protected]"
git config user.name "nf-core-bot"
git config push.default upstream
git add .
git status
git commit -m "[automated] autogenerated conda-lock file"
git push
- name: If no conda-lock update
if: steps.commit-and-push.outcome == 'failure'
run: |
echo "No conda-lock update"
# TODO Build containers with Wave