-
Notifications
You must be signed in to change notification settings - Fork 713
167 lines (150 loc) · 5.47 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
name: Wave
# When environment.yml is changed
on:
pull_request:
paths:
- "**/environment.yml"
- "**/Dockerfile"
- "**/spack.yml"
env:
WAVE_VER: "1.2.0"
jobs:
gen-matrix:
name: generate-matrix
runs-on: ubuntu-latest
outputs:
conda-matrix: ${{ steps.conda-diff.outputs.all_changed_files }}
docker-matrix: ${{ steps.docker-diff.outputs.all_changed_files }}
spack-matrix: ${{ steps.spack-diff.outputs.all_changed_files }}
steps:
- uses: actions/checkout@v4
- name: Find conda differences
id: conda-diff
uses: tj-actions/changed-files@v42
with:
json: true
escape_json: false
files: |
modules/**/environment.yml
- name: Find Dockerfile differences
id: docker-diff
uses: tj-actions/changed-files@v42
with:
json: true
escape_json: false
files: |
modules/**/Dockerfile
- name: Find Spack differences
id: spack-diff
uses: tj-actions/changed-files@v42
with:
json: true
escape_json: false
files: |
modules/**/spack.yml
conda-build:
if: "${{ fromJson(needs.gen-matrix.outputs.conda-matrix) }}"
needs: gen-matrix
name: Conda
runs-on: ubuntu-latest
timeout-minutes: 60
strategy:
fail-fast: false
max-parallel: 4
matrix:
files: "${{ fromJson(needs.gen-matrix.outputs.conda-matrix) }}"
steps:
# Use the @nf-core-bot token to check out so we can push later
- uses: actions/checkout@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
run: |
wave --conda-file "${{ matrix.files }}" \
--freeze \
--await \
--build-repo quay.io/nf-core/modules/${{steps.registry-name.outputs.result}} \
--cache-repository quay.io/nf-core/wave-cache \
--tower-token ${{ secrets.TOWER_ACCESS_TOKEN }} \
--tower-workspace-id ${{ secrets.TOWER_WORKSPACE_ID }}
docker-build:
if: "${{ fromJson(needs.gen-matrix.outputs.docker-matrix) }}"
needs: gen-matrix
name: Docker
runs-on: ubuntu-latest
timeout-minutes: 60
strategy:
fail-fast: false
max-parallel: 4
matrix:
files: "${{ fromJson(needs.gen-matrix.outputs.docker-matrix) }}"
steps:
# Use the @nf-core-bot token to check out so we can push later
- uses: actions/checkout@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('/Dockerfile', '').replace('/', '_');
- name: Build container
run: |
wave -f "${{ matrix.files }}" \
--freeze \
--await \
--build-repo quay.io/nf-core/modules/${{steps.registry-name.outputs.result}} \
--cache-repository quay.io/nf-core/wave-cache \
--tower-token ${{ secrets.TOWER_ACCESS_TOKEN }} \
--tower-workspace-id ${{ secrets.TOWER_WORKSPACE_ID }}
# FIXME https://github.com/seqeralabs/wave/issues/351
# spack-build:
# if: "${{ fromJson(needs.gen-matrix.outputs.spack-matrix) }}"
# needs: gen-matrix
# name: Spack
# runs-on: ubuntu-latest
# timeout-minutes: 60
# strategy:
# fail-fast: false
# max-parallel: 4
# matrix:
# files: "${{ fromJson(needs.gen-matrix.outputs.spack-matrix) }}"
# steps:
# # Use the @nf-core-bot token to check out so we can push later
# - uses: actions/checkout@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('/spack.yml', '').replace('/', '_');
# - name: Build container
# run: |
# wave --spack-file "${{ matrix.files }}" \
# --freeze \
# --await \
# --build-repo quay.io/nf-core/modules/${{steps.registry-name.outputs.result}} \
# --cache-repository quay.io/nf-core/wave-cache \
# --tower-token ${{ secrets.TOWER_ACCESS_TOKEN }} \
# --tower-workspace-id ${{ secrets.TOWER_WORKSPACE_ID }}