1- name : nf-core CI
21# This workflow runs the pipeline with the minimal test dataset to check that it completes without any syntax errors
2+ name : nf-core CI
33on :
44 pull_request :
55 release :
66 types : [published]
7+ merge_group :
8+ types :
9+ - checks_requested
10+ branches :
11+ - master
12+ - dev
713
814env :
915 NXF_ANSI_LOG : false
16+ NFTEST_VER : " 0.8.1"
1017
1118concurrency :
1219 group : " ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}"
1320 cancel-in-progress : true
1421
1522jobs :
23+ changes :
24+ name : Check for changes
25+ runs-on : ubuntu-latest
26+ outputs :
27+ # Expose matched filters as job 'tags' output variable
28+ tags : ${{ steps.filter.outputs.changes }}
29+ steps :
30+ - uses : actions/checkout@v3
31+ - name : Combine all tags.yml files
32+ id : get_username
33+ run : find . -name "tags.yml" -not -path "./.github/*" -exec cat {} + > .github/tags.yml
34+ - name : debug
35+ run : cat .github/tags.yml
36+ - uses : dorny/paths-filter@v2
37+ id : filter
38+ with :
39+ filters : " .github/tags.yml"
40+
41+ define_nxf_versions :
42+ name : Choose nextflow versions to test against depending on target branch
43+ runs-on : ubuntu-latest
44+ outputs :
45+ matrix : ${{ steps.nxf_versions.outputs.matrix }}
46+ steps :
47+ - id : nxf_versions
48+ run : |
49+ if [[ "${{ github.event_name }}" == "pull_request" && "${{ github.base_ref }}" == "dev" && "${{ matrix.NXF_VER }}" != "latest-everything" ]]; then
50+ echo matrix='["latest-everything"]' | tee -a $GITHUB_OUTPUT
51+ else
52+ echo matrix='["latest-everything", "23.04.0"]' | tee -a $GITHUB_OUTPUT
53+ fi
54+
1655 test :
17- name : Run pipeline with test data
18- # Only run on push if this is the nf-core dev branch (merged PRs)
19- if : " ${{ github.event_name != 'push' || (github.event_name == 'push' && github.repository == 'nf-core/fetchngs') }} "
56+ name : ${{ matrix.tags }} ${{ matrix.profile }} NF ${{ matrix.NXF_VER }}
57+ needs : [changes, define_nxf_versions]
58+ if : needs.changes.outputs.tags != '[]'
2059 runs-on : ubuntu-latest
2160 strategy :
61+ fail-fast : false
2262 matrix :
23- NXF_VER :
24- - " 23.04.0"
25- - " latest-everything"
63+ NXF_VER : ${{ fromJson(needs.define_nxf_versions.outputs.matrix) }}
64+ tags : ["${{ fromJson(needs.changes.outputs.tags) }}"]
65+ profile :
66+ - " docker"
67+
2668 steps :
2769 - name : Check out pipeline code
2870 uses : actions/checkout@v3
@@ -32,29 +74,33 @@ jobs:
3274 with :
3375 version : " ${{ matrix.NXF_VER }}"
3476
35- - name : Run pipeline with test data
36- run : |
37- nextflow run ${GITHUB_WORKSPACE} -profile test,docker --outdir ./results
77+ - name : Cache nf-test installation
78+ id : cache-software
79+ uses : actions/cache@v3
80+ with :
81+ path : |
82+ /usr/local/bin/nf-test
83+ /home/runner/.nf-test/nf-test.jar
84+ key : ${{ runner.os }}-${{ env.NFTEST_VER }}-nftest
3885
39- parameters :
40- name : Test workflow parameters
41- if : ${{ github.event_name != 'push' || (github.event_name == 'push' && github.repository == 'nf-core/fetchngs') }}
42- runs-on : ubuntu-latest
43- strategy :
44- matrix :
45- parameters :
46- - " --nf_core_pipeline rnaseq"
47- - " --ena_metadata_fields run_accession,experiment_accession,library_layout,fastq_ftp,fastq_md5 --sample_mapping_fields run_accession,library_layout"
48- - " --skip_fastq_download"
49- - " --force_sratools_download"
50- steps :
51- - name : Check out pipeline code
52- uses : actions/checkout@v2
86+ - name : Install nf-test
87+ if : steps.cache-software.outputs.cache-hit != 'true'
88+ run : |
89+ wget -qO- https://code.askimed.com/install/nf-test | bash
90+ sudo mv nf-test /usr/local/bin/
5391
54- - name : Install Nextflow
92+ - name : Run nf-test
5593 run : |
56- wget -qO- get.nextflow.io | bash
57- sudo mv nextflow /usr/local/bin/
58- - name : Run pipeline with various parameters
94+ nf-test test --tag ${{ matrix.tags }} --profile "test,${{ matrix.profile }}" --junitxml=test.xml
95+
96+ - name : Output log on failure
97+ if : failure()
5998 run : |
60- nextflow run ${GITHUB_WORKSPACE} -profile test,docker --outdir ./results ${{ matrix.parameters }}
99+ sudo apt install bat > /dev/null
100+ batcat --decorations=always --color=always ${{ github.workspace }}/.nf-test/tests/*/meta/nextflow.log
101+
102+ - name : Publish Test Report
103+ uses : mikepenz/action-junit-report@v3
104+ if : always() # always run even if the previous step fails
105+ with :
106+ report_paths : test.xml
0 commit comments