-
Notifications
You must be signed in to change notification settings - Fork 21
362 lines (314 loc) · 11.5 KB
/
ci.yaml
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
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
# ==================================================================================================
# Header
# ==================================================================================================
name: CI
on:
pull_request:
push:
branches:
- master
- dev
# ==================================================================================================
# Jobs
# ==================================================================================================
jobs:
# ==========================================================================
# test
# ==========================================================================
test:
# if: ${{ false }} # disable for now
runs-on: ${{ matrix.os }}
defaults:
run:
# Need to specify the shell explicitly.
# https://github.com/marketplace/actions/setup-miniconda#important
# https://github.com/conda-incubator/setup-miniconda#use-a-default-shell
shell: bash -el {0}
# -------------------------------------------------------
# Matrix
# -------------------------------------------------------
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
# - macos-latest
# - ubuntu-20.04
# - ubuntu-22.04
# - ubuntu-24.04
# - macos-13
# - macos-14
# Test cases as listed in test/cases/*.txt
# We update them automatically when running the test/run.sh script, so that each time
# we have and run a new test case, it also appears here. The script to run this update
# is located in .github/workflows/update-cases.sh
case:
# CASES_BEGIN
- base
- calling-bcftools-1
- calling-bcftools-2
- calling-bcftools-3
- calling-bcftools-4
- calling-freebayes-1
- calling-freebayes-2
- calling-freebayes-3
- calling-haplotypecaller-1
- calling-haplotypecaller-2
- calling-haplotypecaller-3
- calling-haplotypecaller-4
- download
- duplicates-dedup-1
- duplicates-dedup-2
- hafpipe-1
- hafpipe-2
- hafpipe-3
- hafpipe-4
- mapping-bowtie2-1
- mapping-bowtie2-2
- mapping-bwa-aln-1
- mapping-bwa-aln-2
- mapping-bwa-aln-3
- mapping-bwa-aln-4
- mapping-bwa-mem-1
- mapping-bwa-mem2-1
- mapping-bwa-mem2-2
- mappings-table
- pileup-1
- trimming-adapterremoval-1
- trimming-adapterremoval-2
- trimming-adapterremoval-3
- trimming-cutadapt-1
- trimming-cutadapt-2
- trimming-fastp-1
- trimming-fastp-2
- trimming-fastp-3
- trimming-none
- trimming-seqprep-1
- trimming-seqprep-2
- trimming-skewer-1
- trimming-skewer-2
# CASES_END
installer:
# - conda
- mamba
include:
# Also test with other operating systems.
# For now, we just test the base case to see if it's generally working.
# This repeats one of the Ubuntu runs for the base case, but that's okay
# to keep it future proof when the default ubuntu-latest changes.
- os: ubuntu-20.04
case: base
- os: ubuntu-22.04
case: base
- os: ubuntu-24.04
case: base
- os: macos-13
case: base
# - os: macos-14
# case: base
# -------------------------------------------------------
# Steps
# -------------------------------------------------------
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Conda
# uses: conda-incubator/[email protected]
uses: mamba-org/[email protected]
with:
# We need mamba here already, otherwise we run into
# https://github.com/conda-incubator/setup-miniconda/issues/262
# mamba-version: "*"
# python-version: 3.12
# channels: conda-forge,defaults
# channel-priority: true
# use-mamba: true
# environment-file: workflow/envs/grenepipe.yaml
# activate-environment: grenepipe
# We might need to replace the above, at least for now, due to instabilities in the action,
# see https://github.com/conda-incubator/setup-miniconda/issues/274#issue-1531425010
# If that changes again in the future, also change it below in the other jobs.
# miniforge-variant: Mambaforge
# miniforge-version: latest
# New workaround suggestion:
# https://github.com/conda-incubator/setup-miniconda/issues/292#issuecomment-1767669652
# Why is this stuff so broken all the time?
# miniforge-variant: Mambaforge
# miniforge-version: latest
# use-mamba: true
# channels: conda-forge,defaults
# environment-file: workflow/envs/grenepipe.yaml
# activate-environment: grenepipe
# Nope, the above also does not work, this time due to
# https://github.com/snakemake/snakemake/issues/3108
# So now we try to use a completely different setup, and hope that that works,
# at least for now...
micromamba-version: '1.5.8-0'
environment-file: workflow/envs/grenepipe.yaml
environment-name: grenepipe
init-shell: bash
post-cleanup: 'all'
# Manually create the conda env.
# Not needed at the moment, as the above setup works (if it works).
# Keeping this here for reference.
# - name: Install Conda Env
# shell: bash -el {0}
# run: |
# mamba env create -f workflow/envs/grenepipe.yaml -n grenepipe
# Then in the run step:
# conda activate grenepipe
# Run the test case.
- name: Run Test
run: |
conda info
mamba info
if [[ "${{ matrix.installer }}" == "conda" ]]; then
export GRENEPIPE_TESTS_NO_MAMBA=1
fi
./test/run.sh ${{ matrix.case }}
# Store a list of all files and sizes, for debugging.
- name: File Inventory
if: always()
run: |
mkdir -p test/out-${{ matrix.case }}/logs
ls -alFR test/out-${{ matrix.case }} > test/out-${{ matrix.case }}/logs/files.txt
ls -alFR test/reference >> test/out-${{ matrix.case }}/logs/files.txt
# Upload the log files as a GitHub Actions artifact
- name: Upload Logs
if: always()
uses: actions/upload-artifact@v4
with:
name: logs-test-${{ matrix.os }}-${{ matrix.case }}
path: |
test/out-${{ matrix.case }}/config.yaml
test/out-${{ matrix.case }}/test-run.log
test/out-${{ matrix.case }}/logs/
test/out-${{ matrix.case }}/.snakemake/log/
test/reference/logs/
test/reference/TAIR10_chr_all.dict
# ==========================================================================
# example
# ==========================================================================
example:
# if: ${{ false }} # disable for now
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash -el {0}
# -------------------------------------------------------
# Matrix
# -------------------------------------------------------
strategy:
fail-fast: false
matrix:
os:
- ubuntu-20.04
- ubuntu-22.04
- ubuntu-24.04
- macos-13
# - macos-14
# -------------------------------------------------------
# Steps
# -------------------------------------------------------
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Conda
# uses: conda-incubator/[email protected]
uses: mamba-org/[email protected]
with:
# mamba-version: "*"
# channels: conda-forge
# Need to use a different setup to get mamba to work, see above.
# miniforge-variant: Mambaforge
# miniforge-version: latest
# use-mamba: true
# channels: conda-forge,defaults
# environment-file: workflow/envs/grenepipe.yaml
# activate-environment: grenepipe
# Same as above, need a different setup here...
micromamba-version: '1.5.8-0'
environment-file: workflow/envs/grenepipe.yaml
environment-name: grenepipe
init-shell: bash
post-cleanup: 'all'
- name: Run Example
run: |
./example/prepare.sh
snakemake --use-conda --conda-frontend mamba --cores 4 --directory example/ 2>&1 | tee example/run.log
- name: Upload Logs
if: always()
uses: actions/upload-artifact@v4
with:
name: logs-example-${{ matrix.os }}
path: |
example/run.log
example/logs/
example/.snakemake/log/
# ==========================================================================
# envs
# ==========================================================================
envs:
# if: ${{ false }} # disable for now
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash -el {0}
# -------------------------------------------------------
# Matrix
# -------------------------------------------------------
strategy:
fail-fast: false
matrix:
os:
- ubuntu-20.04
- ubuntu-22.04
- ubuntu-24.04
- macos-13
# - macos-14
installer:
# Conda is just waaaay to slow... some runs even exceed the GitHub Actions
# max runtime of 6h, so we have to deactivate it for now.
# - conda
- mamba
- micromamba
# -------------------------------------------------------
# Steps
# -------------------------------------------------------
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Conda
uses: mamba-org/[email protected]
with:
# Trying another installer, see if that one finally works,
# and to test if both mamba and micromamba work for all envs.
# Any version from https://github.com/mamba-org/micromamba-releases
micromamba-version: '1.5.8-0'
environment-file: workflow/envs/grenepipe.yaml
environment-name: grenepipe
init-shell: bash
post-cleanup: 'all'
- name: Install Envs
shell: bash -el {0}
run: |
cd workflow/envs
for env in `ls *.yaml` ; do
name=${env%.yaml}
printf "\n" ; printf '=%.0s' {1..100}
printf "\n ${name}\n"
printf '=%.0s' {1..100} ; printf "\n\n"
if [[ "$name" = "grenepipe" ]]; then
echo "Skipping grenepipe"
continue
fi
if [[ ${{ matrix.os }} == macos* ]] && [[ "${name}" == *-linux ]]; then
echo "Skipping linux env on macos"
continue
fi
if [[ ${{ matrix.os }} == ubuntu* ]] && [[ "${name}" == *-macos ]]; then
echo "Skipping macos env on linux"
continue
fi
${{ matrix.installer }} env create -f ${env} -n ${name}
done