-
Notifications
You must be signed in to change notification settings - Fork 35
144 lines (128 loc) · 5.38 KB
/
ci.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
name: nf-core CI
# This workflow runs the pipeline with the minimal test dataset to check that it completes without any syntax errors
on:
push:
branches:
- dev
pull_request:
release:
types: [published]
workflow_dispatch:
env:
NXF_ANSI_LOG: false
NXF_SINGULARITY_CACHEDIR: ${{ github.workspace }}/.singularity
NXF_SINGULARITY_LIBRARYDIR: ${{ github.workspace }}/.singularity
concurrency:
group: "${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}"
cancel-in-progress: true
jobs:
test:
env:
NXF_ANSI_LOG: false
CAPSULE_LOG: none
TEST_PROFILE: ${{ matrix.test_profile }}
EXEC_PROFILE: ${{ matrix.exec_profile }}
name: Run pipeline with test data
# Only run on push if this is the nf-core dev branch (merged PRs)
if: ${{ github.event_name != 'push' || (github.event_name == 'push' && github.repository == 'nf-core/quantms') }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# Nextflow versions
NXF_VER:
- "24.04.2"
- "latest-everything"
test_profile:
["test_lfq", "test_lfq_sage", "test_dia", "test_localize", "test_tmt", "test_dda_id", "test_tmt_corr"]
exec_profile: ["docker"]
exclude:
- test_profile: test_dia
exec_profile: conda
- test_profile: test_localize
exec_profile: conda
- NXF_VER: "latest-everything"
exec_profile: "conda"
include:
- test_profile: test_latest_dia
exec_profile: singularity
- test_profile: test_lfq
exec_profile: conda
- test_profile: test_dda_id
exec_profile: conda
steps:
- name: Check out pipeline code
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4
- name: Set up Nextflow
uses: nf-core/setup-nextflow@v2
with:
version: "${{ matrix.NXF_VER }}"
- name: Set up Apptainer
if: matrix.profile == 'singularity'
uses: eWaterCycle/setup-apptainer@main
- name: Set up Singularity
if: matrix.profile == 'singularity'
run: |
mkdir -p $NXF_SINGULARITY_CACHEDIR
mkdir -p $NXF_SINGULARITY_LIBRARYDIR
- name: Install micromamba
env:
MAMBA_ROOT_PREFIX: ${{ github.workspace }}/.micromamba
if: matrix.exec_profile == 'conda'
run: |
wget -qO- https://micromamba.snakepit.net/api/micromamba/linux-64/latest | tar -xvj bin/micromamba
echo "$(pwd)/bin" >> $GITHUB_PATH
echo "$(pwd)/micromamba/bin" >> $GITHUB_PATH
./bin/micromamba shell init -s bash
echo $'channels:\n - conda-forge\n - bioconda\n - defaults\nuse_lockfiles: false' >> ~/.mambarc
- name: Install Singularity with defaults
if: matrix.exec_profile == 'singularity'
uses: singularityhub/install-singularity@main
- name: Disk space cleanup
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1
- name: Run pipeline with test data in docker/singularity profile
if: matrix.exec_profile == 'docker' || matrix.exec_profile == 'singularity'
# TODO nf-core: You can customise CI pipeline run tests as required
# For example: adding multiple test runs with different parameters
# Remember that you can parallelise this by using strategy.matrix
run: |
nextflow run ${GITHUB_WORKSPACE} -profile $TEST_PROFILE,$EXEC_PROFILE --outdir ${TEST_PROFILE}_${EXEC_PROFILE}_results
- name: Run pipeline with test data in conda profile (and single-threaded)
env:
MAMBA_ROOT_PREFIX: ${{ github.workspace }}/.micromamba
if: matrix.exec_profile == 'conda'
# TODO nf-core: You can customise CI pipeline run tests as required
# For example: adding multiple test runs with different parameters
# Remember that you can parallelise this by using strategy.matrix
run: |
nextflow run ${GITHUB_WORKSPACE} -profile $TEST_PROFILE,micromamba --outdir ${TEST_PROFILE}_${EXEC_PROFILE}_results
- name: Gather failed logs
if: failure() || cancelled()
run: |
mkdir failed_logs
failed=$(grep "FAILED" ${TEST_PROFILE}_${EXEC_PROFILE}_results/pipeline_info/execution_trace.txt | cut -f 2)
while read -r line ; do cp $(ls work/${line}*/*.log) failed_logs/ | true ; done <<< "$failed"
- uses: actions/upload-artifact@v4
if: failure() || cancelled()
name: Upload failed logs
with:
name: failed_logs_${{ matrix.test_profile }}_${{ matrix.exec_profile }}_${{ matrix.NXF_VER }}
include-hidden-files: true
path: failed_logs
overwrite: false
- uses: actions/upload-artifact@v4
if: always()
name: Upload results
with:
name: ${{ matrix.test_profile }}_${{ matrix.exec_profile }}_${{ matrix.NXF_VER }}_results
include-hidden-files: true
path: ${{ matrix.test_profile }}_${{ matrix.exec_profile }}_results
overwrite: false
- uses: actions/upload-artifact@v4
if: always()
name: Upload log
with:
name: nextflow_${{ matrix.test_profile }}_${{ matrix.exec_profile }}_${{ matrix.NXF_VER }}.log
include-hidden-files: true
path: .nextflow.log
overwrite: false