-
Notifications
You must be signed in to change notification settings - Fork 741
81 lines (70 loc) · 2.43 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
name: Wave
# When environment.yml is changed
on:
pull_request:
paths:
- "**/environment.yml"
env:
WAVE_VER: "1.4.1"
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
# TODO Add Dockerfiles
files: |
modules/**/environment.yml
- name: Debug
run: echo ${{ steps.diff.outputs.all_changed_files }}
- id: set-matrix
run: echo "matrix={\"profile\":[\"docker\", \"singularity\"],\"files\":${{ steps.diff.outputs.all_changed_files }} }" >> "$GITHUB_OUTPUT"
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
build:
if: "${{ fromJson(needs.gen-matrix.outputs.matrix) }}"
needs: gen-matrix
name: build
runs-on: ubuntu-latest
timeout-minutes: 60
strategy:
fail-fast: false
matrix: "${{ fromJson(needs.gen-matrix.outputs.matrix) }}"
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4
- name: Install wave-cli
run: |
wget -q https://github.com/seqeralabs/wave-cli/releases/download/v${WAVE_VER}/wave-${WAVE_VER}-linux-x86_64
sudo mv wave-${WAVE_VER}-linux-x86_64 /usr/local/bin/wave
chmod +x /usr/local/bin/wave
- name: Create a registry name
uses: actions/github-script@v7
id: registry-name
with:
result-encoding: string
script: |
return '${{ matrix.files }}'.replace('modules/nf-core/', '').replace('/environment.yml', '').replace('/', '_');
- name: Build container
if: matrix.profile == 'docker'
run: |
wave --conda-file "${{ matrix.files }}" \
--freeze \
--await \
--tower-token ${{ secrets.TOWER_ACCESS_TOKEN }} \
--tower-workspace-id ${{ secrets.TOWER_WORKSPACE_ID }}
- name: Build Singularity
if: matrix.profile == 'singularity'
run: |
wave --conda-file "${{ matrix.files }}" \
--freeze \
--await \
--tower-token ${{ secrets.TOWER_ACCESS_TOKEN }} \
--tower-workspace-id ${{ secrets.TOWER_WORKSPACE_ID }} \
--singularity
# TODO Build from Dockerfiles