-
Notifications
You must be signed in to change notification settings - Fork 713
522 lines (472 loc) · 16.1 KB
/
test.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
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
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
name: test
on:
push:
branches: [master]
pull_request:
branches: [master]
merge_group:
types: [checks_requested]
branches: [master]
# Cancel if a newer run is started
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
prettier:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Install NodeJS
uses: actions/setup-node@v3
- name: Install Prettier
run: npm install -g prettier
- name: Run Prettier --check
run: prettier --check .
editorconfig:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- name: Install editorconfig-checker
run: npm install -g editorconfig-checker
- name: Run ECLint check
run: editorconfig-checker -exclude README.md $(git ls-files | grep -v test)
pytest-changes:
name: pytest-changes
runs-on: ubuntu-latest
outputs:
# Expose matched filters as job 'modules' output variable
modules: ${{ steps.filter.outputs.changes }}
steps:
- uses: actions/checkout@v3
- uses: dorny/paths-filter@v2
id: filter
with:
filters: "tests/config/pytest_modules.yml"
nf-core-lint:
runs-on: ubuntu-20.04
name: nf-core-lint
needs: [pytest-changes]
if: needs.pytest-changes.outputs.modules != '[]'
strategy:
fail-fast: false
matrix:
tags: ["${{ fromJson(needs.pytest-changes.outputs.modules) }}"]
exclude:
- tags: "nf-test"
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"
- uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Install pip
run: python -m pip install --upgrade pip
- name: Install nf-core tools
run: python -m pip install nf-core
- name: Install Nextflow
env:
CAPSULE_LOG: none
run: |
wget -qO- get.nextflow.io | bash
sudo mv nextflow /usr/local/bin/
- name: Lint ${{ matrix.tags }}
run: nf-core modules lint ${{ matrix.tags }}
# HACK
if: startsWith( matrix.tags, 'subworkflow' ) != true
- uses: actions/cache@v3
with:
path: /usr/local/bin/nextflow
key: ${{ runner.os }}
restore-keys: |
${{ runner.os }}
pytest:
runs-on: ubuntu-20.04
name: pytest
needs: [pytest-changes]
if: needs.pytest-changes.outputs.modules != '[]'
strategy:
fail-fast: false
matrix:
tags: ["${{ fromJson(needs.pytest-changes.outputs.modules) }}"]
profile: ["docker", "singularity", "conda"]
exclude:
- tags: "nf-test"
- profile: "conda"
tags: annotsv
- profile: "conda"
tags: cellpose
- profile: "conda"
tags: mcquant
- profile: "conda"
tags: bases2fastq
- profile: "conda"
tags: backsub
- profile: "conda"
tags: basicpy
- profile: "conda"
tags: bcl2fastq
- profile: "conda"
tags: bclconvert
- profile: "conda"
tags: cellranger/count
- profile: "conda"
tags: cellranger/mkfastq
- profile: "conda"
tags: cellranger/mkgtf
- profile: "conda"
tags: cellranger/mkref
- profile: "conda"
tags: cellranger/mkvdjref
- profile: "conda"
tags: cellranger/multi
- profile: "conda"
tags: cellranger/vdj
- profile: "conda"
tags: coreograph
- profile: "conda"
tags: deepcell/mesmer
- profile: "conda"
tags: deepvariant
- profile: "conda"
tags: fastk/fastk
- profile: "conda"
tags: fastk/histex
- profile: "conda"
tags: fastk/merge
- profile: "conda"
tags: fcs/fcsadaptor
- profile: "conda"
tags: fcs/fcsgx
- profile: "conda"
tags: gatk4/baserecalibratorspark
- profile: "conda"
tags: gatk4/cnnscorevariants
- profile: "conda"
tags: gatk4/determinegermlinecontigploidy
- profile: "conda"
tags: gatk4/germlinecnvcaller
- profile: "conda"
tags: gatk4/markduplicatesspark
- profile: "conda"
tags: gatk4/postprocessgermlinecnvcalls
- profile: "conda"
tags: genescopefk
- profile: "conda"
tags: ilastik/multicut
- profile: "conda"
tags: ilastik/pixelclassification
- profile: "conda"
tags: imputeme/vcftoprs
- profile: "conda"
tags: merquryfk/katcomp
- profile: "conda"
tags: merquryfk/katgc
- profile: "conda"
tags: merquryfk/merquryfk
- profile: "conda"
tags: merquryfk/ploidyplot
- profile: "conda"
tags: mitohifi/findmitoreference
- profile: "conda"
tags: scimap/mcmicro
- profile: "conda"
tags: sentieon/applyvarcal
- profile: "conda"
tags: sentieon/bwaindex
- profile: "conda"
tags: sentieon/bwamem
- profile: "conda"
tags: sentieon/dedup
- profile: "conda"
tags: sentieon/gvcftyper
- profile: "conda"
tags: sentieon/haplotyper
- profile: "conda"
tags: sentieon/varcal
- profile: "conda"
tags: spaceranger/count
- profile: "conda"
tags: spaceranger/mkgtf
- profile: "conda"
tags: spaceranger/mkref
- profile: "conda"
tags: universc
- profile: "singularity"
tags: universc
- profile: "singularity"
tags: gatk4/determinegermlinecontigploidy
- profile: "conda"
tags: subworkflows/bcl_demultiplex
- profile: "conda"
tags: subworkflows/fasta_clean_fcs
- profile: "conda"
tags: islandpath
env:
NXF_ANSI_LOG: false
SENTIEON_LICENSE_BASE64: ${{ secrets.SENTIEON_LICENSE_BASE64 }}
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"
- uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install Python dependencies
run: python -m pip install --upgrade pip pytest-workflow cryptography
- uses: actions/cache@v3
with:
path: /usr/local/bin/nextflow
key: ${{ runner.os }}
restore-keys: |
${{ runner.os }}-nextflow-
- name: Install Nextflow
env:
CAPSULE_LOG: none
run: |
wget -qO- get.nextflow.io | bash
sudo mv nextflow /usr/local/bin/
- name: Set up Singularity
if: matrix.profile == 'singularity'
uses: eWaterCycle/setup-singularity@v7
with:
singularity-version: 3.7.1
- name: Set up miniconda
if: matrix.profile == 'conda'
uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
channels: conda-forge,bioconda,defaults
python-version: ${{ matrix.python-version }}
- name: Conda setup
if: matrix.profile == 'conda'
run: |
conda clean -a
conda install -n base conda-libmamba-solver
conda config --set solver libmamba
# Set up secrets
- name: Set up nextflow secrets
if: env.SENTIEON_LICENSE_BASE64 != null
run: |
nextflow secrets set SENTIEON_LICENSE_BASE64 ${{ secrets.SENTIEON_LICENSE_BASE64 }}
nextflow secrets set SENTIEON_AUTH_MECH_BASE64 ${{ secrets.SENTIEON_AUTH_MECH_BASE64 }}
SENTIEON_ENCRYPTION_KEY=$(echo -n "${{ secrets.ENCRYPTION_KEY_BASE64 }}" | base64 -d)
SENTIEON_LICENSE_MESSAGE=$(echo -n "${{ secrets.LICENSE_MESSAGE_BASE64 }}" | base64 -d)
SENTIEON_AUTH_DATA=$(python tests/modules/nf-core/sentieon/license_message.py encrypt --key "$SENTIEON_ENCRYPTION_KEY" --message "$SENTIEON_LICENSE_MESSAGE")
SENTIEON_AUTH_DATA_BASE64=$(echo -n "$SENTIEON_AUTH_DATA" | base64 -w 0)
nextflow secrets set SENTIEON_AUTH_DATA_BASE64 $SENTIEON_AUTH_DATA_BASE64
# Test the module
- name: Run pytest-workflow
# only use one thread for pytest-workflow to avoid race condition on conda cache.
run: TMPDIR=~ PROFILE=${{ matrix.profile }} pytest --tag ${{ matrix.tags }} --symlink --kwdof --git-aware --color=yes
- name: Output log on failure
if: failure()
run: |
sudo apt-get update > /dev/null
sudo apt-get install bat > /dev/null
batcat --decorations=always --color=always /home/runner/pytest_workflow_*/*/log.{out,err}
- name: Setting global variables
uses: actions/github-script@v6
id: parsed
with:
script: |
return '${{ matrix.tags }}'.toLowerCase().replaceAll(/\//g, '-').trim('-').trim('"')
result-encoding: string
- name: Upload logs on failure
if: failure()
uses: actions/upload-artifact@v2
with:
name: logs-${{ matrix.profile }}-${{ steps.parsed.outputs.result }}
path: |
/home/runner/pytest_workflow_*/*/.nextflow.log
/home/runner/pytest_workflow_*/*/log.out
/home/runner/pytest_workflow_*/*/log.err
/home/runner/pytest_workflow_*/*/work
!/home/runner/pytest_workflow_*/*/work/conda
!/home/runner/pytest_workflow_*/*/work/singularity
nf-test-changes:
name: nf-test-changes
runs-on: ubuntu-latest
outputs:
# Expose matched filters as job 'modules' output variable
modules: ${{ steps.filter.outputs.changes }}
steps:
- uses: actions/checkout@v3
- uses: dorny/paths-filter@v2
id: filter
with:
filters: "tests/config/nftest_modules.yml"
nf-test:
runs-on: ubuntu-20.04
name: nf-test
needs: [nf-test-changes]
if: needs.nf-test-changes.outputs.modules != '[]'
strategy:
fail-fast: false
matrix:
tags: ["${{ fromJson(needs.nf-test-changes.outputs.modules) }}"]
profile: ["docker", "singularity", "conda"]
exclude:
- tags: "nf-test"
- profile: "conda"
tags: annotsv
- profile: "conda"
tags: bases2fastq
- profile: "conda"
tags: bcl2fastq
- profile: "conda"
tags: bclconvert
- profile: "conda"
tags: cellranger/count
- profile: "conda"
tags: cellranger/mkfastq
- profile: "conda"
tags: cellranger/mkgtf
- profile: "conda"
tags: cellranger/mkref
- profile: "conda"
tags: deepvariant
- profile: "conda"
tags: ensemblvep/vep
- profile: "conda"
tags: fastk/fastk
- profile: "conda"
tags: fastk/histex
- profile: "conda"
tags: fastk/merge
- profile: "conda"
tags: fcs/fcsadaptor
- profile: "conda"
tags: fcs/fcsgx
- profile: "conda"
tags: gatk4/cnnscorevariants
- profile: "conda"
tags: gatk4/determinegermlinecontigploidy
- profile: "conda"
tags: genescopefk
- profile: "conda"
tags: ilastik/multicut
- profile: "conda"
tags: ilastik/pixelclassification
- profile: "conda"
tags: imputeme/vcftoprs
- profile: "conda"
tags: merquryfk/katcomp
- profile: "conda"
tags: merquryfk/katgc
- profile: "conda"
tags: merquryfk/merquryfk
- profile: "conda"
tags: merquryfk/ploidyplot
- profile: "conda"
tags: sentieon/bwaindex
- profile: "conda"
tags: sentieon/bwamem
- profile: "conda"
tags: universc
- profile: "singularity"
tags: universc
- profile: "conda"
tags: subworkflows/vcf_annotate_ensemblvep
env:
NXF_ANSI_LOG: false
SENTIEON_LICENSE_BASE64: ${{ secrets.SENTIEON_LICENSE_BASE64 }}
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: /usr/local/bin/nextflow
key: ${{ runner.os }}
restore-keys: |
${{ runner.os }}-nextflow-
- name: Install Nextflow
env:
CAPSULE_LOG: none
run: |
wget -qO- get.nextflow.io | bash
sudo mv nextflow /usr/local/bin/
- name: Cache nf-test installation
id: cache-software
uses: actions/cache@v3
with:
path: |
/usr/local/bin/nf-test
/home/runner/.nf-test/nf-test.jar
key: ${{ runner.os }}-nftest
- name: Install nf-test
if: steps.cache-software.outputs.cache-hit != 'true'
run: |
wget -qO- https://code.askimed.com/install/nf-test | bash
sudo mv nf-test /usr/local/bin/
- name: Set up Singularity
if: matrix.profile == 'singularity'
uses: eWaterCycle/setup-singularity@v7
with:
singularity-version: 3.7.1
- name: Set up miniconda
if: matrix.profile == 'conda'
uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
channels: conda-forge,bioconda,defaults
python-version: ${{ matrix.python-version }}
- name: Conda setup
if: matrix.profile == 'conda'
run: |
conda clean -a
conda install -n base conda-libmamba-solver
conda config --set solver libmamba
# Set up secrets
- name: Set up nextflow secrets
if: env.SENTIEON_LICENSE_BASE64 != null
run: |
nextflow secrets set SENTIEON_LICENSE_BASE64 ${{ secrets.SENTIEON_LICENSE_BASE64 }}
nextflow secrets set SENTIEON_AUTH_MECH_BASE64 ${{ secrets.SENTIEON_AUTH_MECH_BASE64 }}
SENTIEON_ENCRYPTION_KEY=$(echo -n "${{ secrets.ENCRYPTION_KEY_BASE64 }}" | base64 -d)
SENTIEON_LICENSE_MESSAGE=$(echo -n "${{ secrets.LICENSE_MESSAGE_BASE64 }}" | base64 -d)
SENTIEON_AUTH_DATA=$(python tests/modules/nf-core/sentieon/license_message.py encrypt --key "$SENTIEON_ENCRYPTION_KEY" --message "$SENTIEON_LICENSE_MESSAGE")
SENTIEON_AUTH_DATA_BASE64=$(echo -n "$SENTIEON_AUTH_DATA" | base64 -w 0)
nextflow secrets set SENTIEON_AUTH_DATA_BASE64 $SENTIEON_AUTH_DATA_BASE64
# Test the module
- name: Run nf-test
run: |
nf-test test \
--profile=${{ matrix.profile }} \
--tag ${{ matrix.tags }} \
--tap=test.tap
- uses: pcolby/tap-summary@v1
with:
path: >-
test.tap
confirm-pass:
runs-on: ubuntu-latest
needs: [prettier, editorconfig, pytest-changes, nf-core-lint, pytest, nf-test-changes, nf-test]
if: always()
steps:
- name: All tests ok
if: ${{ success() || !contains(needs.*.result, 'failure') }}
run: exit 0
- name: One or more tests failed
if: ${{ contains(needs.*.result, 'failure') }}
run: exit 1
- name: debug-print
if: always()
run: |
echo "toJSON(needs) = ${{ toJSON(needs) }}"
echo "toJSON(needs.*.result) = ${{ toJSON(needs.*.result) }}"