1
1
name : Run nf-test
2
2
on :
3
- push :
4
- branches :
5
- - dev
6
- - master
7
- - main
8
- paths-ignore :
9
- - " docs/**"
10
- - " **/meta.yml"
11
- - " **/*.md"
12
- - " **/*.png"
13
- - " **/*.svg"
14
3
pull_request :
15
4
paths-ignore :
16
5
- " docs/**"
39
28
nf-test-changes :
40
29
name : nf-test-changes
41
30
runs-on : # use self-hosted runners
42
- - runs-on=$-nf-test-changes
31
+ - runs-on=${{ github.run_id }} -nf-test-changes
43
32
- runner=4cpu-linux-x64
33
+ - disk=large
44
34
outputs :
45
35
shard : ${{ steps.set-shards.outputs.shard }}
46
36
total_shards : ${{ steps.set-shards.outputs.total_shards }}
74
64
needs : [nf-test-changes]
75
65
if : ${{ needs.nf-test-changes.outputs.total_shards != '0' }}
76
66
runs-on : # use self-hosted runners
77
- - runs-on=$-nf-test
67
+ - runs-on=${{ github.run_id }} -nf-test
78
68
- runner=4cpu-linux-x64
79
69
- disk=large
80
70
strategy :
91
81
- isMain : false
92
82
profile : " singularity"
93
83
NXF_VER :
94
- - " 24.04.2 "
84
+ - " 24.10.5 "
95
85
- " latest-everything"
96
86
env :
97
87
NXF_ANSI_LOG : false
@@ -103,138 +93,39 @@ jobs:
103
93
fetch-depth : 0
104
94
105
95
- name : Run nf-test
96
+ id : run_nf_test
106
97
uses : ./.github/actions/nf-test
98
+ continue-on-error : ${{ matrix.NXF_VER == 'latest-everything' }}
107
99
env :
108
100
NFT_WORKDIR : ${{ env.NFT_WORKDIR }}
109
101
with :
110
102
profile : ${{ matrix.profile }}
111
103
shard : ${{ matrix.shard }}
112
104
total_shards : ${{ env.TOTAL_SHARDS }}
113
- tags : modules_local,subworkflows_local
114
-
115
- pipeline-tests :
116
- name : " Pipeline Test | ${{ matrix.test_name }} | ${{ matrix.NXF_VER }} | ${{ matrix.profile }}"
117
- runs-on : ubuntu-latest
118
- strategy :
119
- fail-fast : false
120
- matrix :
121
- test_name :
122
- - " default"
123
- - " main_pipeline_build"
124
- - " main_pipeline_extend"
125
- - " main_pipeline_sub"
126
- - " main_pipeline_qc"
127
- - " main_pipeline_reference_mapping"
128
- profile : [conda, docker, singularity]
129
- isMain :
130
- - ${{ github.base_ref == 'master' || github.base_ref == 'main' }}
131
- # Exclude conda and singularity on dev
132
- exclude :
133
- - isMain : false
134
- profile : " conda"
135
- - isMain : false
136
- profile : " singularity"
137
- NXF_VER :
138
- - " 24.04.2"
139
- - " latest-everything"
140
- steps :
141
- - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
142
- with :
143
- fetch-depth : 0
144
-
145
- - name : Disk space cleanup
146
- uses : jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1
147
105
148
- - name : Setup Nextflow
149
- uses : nf-core/setup-nextflow@v2
150
- with :
151
- version : " ${{ matrix.NXF_VER }}"
152
-
153
- - name : Set up Python
154
- uses : actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
155
- with :
156
- python-version : " 3.13"
157
-
158
- - name : Install nf-test
159
- uses : nf-core/setup-nf-test@v1
160
- with :
161
- version : ${{ env.NFT_VER }}
162
- install-pdiff : true
163
-
164
- - name : Setup apptainer
165
- if : contains(matrix.profile, 'singularity')
166
- uses : eWaterCycle/setup-apptainer@main
167
-
168
- - name : Set up Singularity
169
- if : contains(matrix.profile, 'singularity')
170
- shell : bash
171
- run : |
172
- mkdir -p $NXF_SINGULARITY_CACHEDIR
173
- mkdir -p $NXF_SINGULARITY_LIBRARYDIR
174
-
175
- - name : Conda setup
176
- if : contains(matrix.profile, 'conda')
177
- uses : conda-incubator/setup-miniconda@505e6394dae86d6a5c7fbb6e3fb8938e3e863830 # v3
178
- with :
179
- auto-update-conda : true
180
- conda-solver : libmamba
181
- conda-remove-defaults : true
182
-
183
- - name : Run nf-test
184
- shell : bash
185
- env :
186
- NFT_DIFF : ${{ env.NFT_DIFF }}
187
- NFT_DIFF_ARGS : ${{ env.NFT_DIFF_ARGS }}
188
- NFT_WORKDIR : ${{ env.NFT_WORKDIR }}
106
+ - name : Report test status
107
+ if : ${{ always() }}
189
108
run : |
190
- # Make it clear that we're ONLY running tests from the tests directory
191
- # and not including any module or subworkflow tests
192
- nf-test test \
193
- --profile=+${{ matrix.profile }} \
194
- --ci \
195
- --verbose \
196
- --tap=test.tap \
197
- tests/${{ matrix.test_name }}.nf.test
198
-
199
- - name : Generate test summary
200
- if : always()
201
- shell : bash
202
- run : |
203
- # Add header if it doesn't exist (using a token file to track this)
204
- if [ ! -f ".summary_header" ]; then
205
- echo "# 🚀 nf-test results" >> $GITHUB_STEP_SUMMARY
206
- echo "" >> $GITHUB_STEP_SUMMARY
207
- echo "| Status | Test Name | Profile | Nextflow Version |" >> $GITHUB_STEP_SUMMARY
208
- echo "|:------:|-----------|---------|-----------------|" >> $GITHUB_STEP_SUMMARY
209
- touch .summary_header
210
- fi
211
-
212
- if [ -f test.tap ]; then
213
- while IFS= read -r line; do
214
- if [[ $line =~ ^ok ]]; then
215
- test_name="${line#ok }"
216
- # Remove the test number from the beginning
217
- test_name="${test_name#* }"
218
- echo "| ✅ | ${test_name} | ${{ matrix.profile }} | ${{ matrix.NXF_VER }} |" >> $GITHUB_STEP_SUMMARY
219
- elif [[ $line =~ ^not\ ok ]]; then
220
- test_name="${line#not ok }"
221
- # Remove the test number from the beginning
222
- test_name="${test_name#* }"
223
- echo "| ❌ | ${test_name} | ${{ matrix.profile }} | ${{ matrix.NXF_VER }} |" >> $GITHUB_STEP_SUMMARY
224
- fi
225
- done < test.tap
226
- else
227
- echo "| ⚠️ | No test results found | ${{ matrix.profile }} | ${{ matrix.NXF_VER }} |" >> $GITHUB_STEP_SUMMARY
109
+ if [[ "${{ steps.run_nf_test.outcome }}" == "failure" ]]; then
110
+ echo "::error::Test with ${{ matrix.NXF_VER }} failed"
111
+ # Add to workflow summary
112
+ echo "## ❌ Test failed: ${{ matrix.profile }} | ${{ matrix.NXF_VER }} | Shard ${{ matrix.shard }}/${{ env.TOTAL_SHARDS }}" >> $GITHUB_STEP_SUMMARY
113
+ if [[ "${{ matrix.NXF_VER }}" == "latest-everything" ]]; then
114
+ echo "::warning::Test with latest-everything failed but will not cause workflow failure. Please check if the error is expected or if it needs fixing."
115
+ fi
116
+ if [[ "${{ matrix.NXF_VER }}" != "latest-everything" ]]; then
117
+ exit 1
118
+ fi
228
119
fi
229
120
230
121
confirm-pass :
231
122
needs : [nf-test, pipeline-tests]
232
123
if : always()
233
124
runs-on : # use self-hosted runners
234
- - runs-on=$-confirm-pass
125
+ - runs-on=${{ github.run_id }} -confirm-pass
235
126
- runner=2cpu-linux-x64
236
127
steps :
237
- - name : One or more tests failed
128
+ - name : One or more tests failed (excluding latest-everything)
238
129
if : ${{ contains(needs.*.result, 'failure') }}
239
130
run : exit 1
240
131
@@ -253,11 +144,3 @@ jobs:
253
144
echo "DEBUG: toJSON(needs) = ${{ toJSON(needs) }}"
254
145
echo "DEBUG: toJSON(needs.*.result) = ${{ toJSON(needs.*.result) }}"
255
146
echo "::endgroup::"
256
-
257
- - name : Clean Workspace # Purge the workspace in case it's running on a self-hosted runner
258
- if : always()
259
- run : |
260
- ls -la ./
261
- rm -rf ./* || true
262
- rm -rf ./.??* || true
263
- ls -la ./
0 commit comments