Skip to content

Commit 6c00433

Browse files
committedJan 22, 2024
Use collect and confirm strategy for tests
Replace Nextflow versioning with simple list matrix
1 parent 4d2d566 commit 6c00433

File tree

1 file changed

+35
-17
lines changed

1 file changed

+35
-17
lines changed
 

‎.github/workflows/ci.yml

+35-17
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ jobs:
3232
steps:
3333
- name: Install Nextflow
3434
uses: nf-core/setup-nextflow@v1
35-
with:
36-
version: "${{ matrix.NXF_VER }}"
3735

3836
- name: Cache nf-test installation
3937
id: cache-software
@@ -99,29 +97,31 @@ jobs:
9997
run: |
10098
echo ${{ steps.list.outputs.tags }}
10199
102-
define_nxf_versions:
103-
name: Choose nextflow versions to test against depending on target branch
104-
runs-on: ubuntu-latest
105-
outputs:
106-
matrix: ${{ steps.nxf_versions.outputs.matrix }}
107-
steps:
108-
- id: nxf_versions
109-
run: |
110-
if [[ "${{ github.event_name }}" == "pull_request" && "${{ github.base_ref }}" == "dev" && "${{ matrix.NXF_VER }}" != "latest-everything" ]]; then
111-
echo matrix='["latest-everything"]' | tee -a $GITHUB_OUTPUT
112-
else
113-
echo matrix='["latest-everything", "23.04.0"]' | tee -a $GITHUB_OUTPUT
114-
fi
100+
# define_nxf_versions:
101+
# name: Choose nextflow versions to test against depending on target branch
102+
# runs-on: ubuntu-latest
103+
# outputs:
104+
# matrix: ${{ steps.nxf_versions.outputs.matrix }}
105+
# steps:
106+
# - id: nxf_versions
107+
# run: |
108+
# if [[ "${{ github.event_name }}" == "pull_request" && "${{ github.base_ref }}" == "dev" && "${{ matrix.NXF_VER }}" != "latest-everything" ]]; then
109+
# echo matrix='["latest-everything"]' | tee -a $GITHUB_OUTPUT
110+
# else
111+
# echo matrix='["latest-everything", "23.04.0"]' | tee -a $GITHUB_OUTPUT
112+
# fi
115113

116114
test:
117115
name: ${{ matrix.tags }} ${{ matrix.profile }} NF-${{ matrix.NXF_VER }}
118-
needs: [changes, define_nxf_versions]
116+
needs: [changes]
119117
if: needs.changes.outputs.changes
120118
runs-on: ubuntu-latest
121119
strategy:
122120
fail-fast: false
123121
matrix:
124-
NXF_VER: ${{ fromJson(needs.define_nxf_versions.outputs.matrix) }}
122+
NXF_VER:
123+
- "latest-everything"
124+
- "23.04"
125125
tags: ["${{ fromJson(needs.changes.outputs.tags) }}"]
126126
profile:
127127
- "docker"
@@ -180,3 +180,21 @@ jobs:
180180
if: always() # always run even if the previous step fails
181181
with:
182182
report_paths: test.xml
183+
184+
confirm-pass:
185+
runs-on: ubuntu-latest
186+
needs: [test]
187+
if: always()
188+
steps:
189+
- name: All tests ok
190+
if: ${{ success() || !contains(needs.*.result, 'failure') }}
191+
run: exit 0
192+
- name: One or more tests failed
193+
if: ${{ contains(needs.*.result, 'failure') }}
194+
run: exit 1
195+
196+
- name: debug-print
197+
if: always()
198+
run: |
199+
echo "toJSON(needs) = ${{ toJSON(needs) }}"
200+
echo "toJSON(needs.*.result) = ${{ toJSON(needs.*.result) }}"

0 commit comments

Comments
 (0)
Please sign in to comment.