-
Notifications
You must be signed in to change notification settings - Fork 218
Description
Description of the bug
I was in the process of merging in some of the more recent GitHub Actions changes from nf-core into my own pipelines and I noticed that the tests that should be run against the minimum Nextflow version for my pipeline (23.04.0) were instead running against the latest version of Nextflow (25.04.7).
In the GitHub Actions logs, I traced this to setup-nextflow/subaction step where it looks like the Nextflow version is an empty string, so it's defaulting to latest Nextflow:
It looks like this may be due to a mismatch in variable names/setting environment variables in the GitHub actions templates made by nf-core.
In the below block of code, the Nextflow version is set under matrix and named NXF_VER:
tools/nf_core/pipeline-template/.github/workflows/nf-test.yml
Lines 71 to 84 in 75e643a
| matrix: | |
| shard: ${{ fromJson(needs.nf-test-changes.outputs.shard) }} | |
| profile: [conda, docker, singularity] | |
| isMain: | |
| - ${{ github.base_ref == 'master' || github.base_ref == 'main' }} | |
| # Exclude conda and singularity on dev | |
| exclude: | |
| - isMain: false | |
| profile: "conda" | |
| - isMain: false | |
| profile: "singularity" | |
| NXF_VER: | |
| - "24.10.5" | |
| - "latest-everything" |
However, in this block of code, it looks like the nf-core/setup-nextflow action is pulling the Nextflow version from an environment variable named NXF_VERSION:
tools/nf_core/pipeline-template/.github/actions/nf-test/action.yml
Lines 22 to 25 in 75e643a
| - name: Setup Nextflow | |
| uses: nf-core/setup-nextflow@v2 | |
| with: | |
| version: "{% raw %}${{ env.NXF_VERSION }}" |
I fixed this in my code by setting an environment variable env.NXF_VERSION with the value from matrix.NXF_VERSION in this block of code:
tools/nf_core/pipeline-template/.github/workflows/nf-test.yml
Lines 85 to 87 in 75e643a
| env: | |
| NXF_ANSI_LOG: false | |
| TOTAL_SHARDS: ${{ needs.nf-test-changes.outputs.total_shards }} |
That is, I added the line:
NXF_VERSION: "${{ matrix.NXF_VER }}"This seems to fix the issue and the correct Nextflow version gets installed:
Command used and terminal output
System information
I created a template using nf-core version 3.3.2 and copied the GitHub actions and workflows into my own pipeline code to keep myself up-to-date.
The pipeline I was updating is here https://github.com/phac-nml/speciesabundance which is maintained by our organization.