Skip to content

Template: run nf-test tests on runsOn runners #3525

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Apr 24, 2025
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
- Add Bluesky badge to readme ([#3475](https://github.com/nf-core/tools/pull/3475))
- Run awsfulltest after release, and with dev revision on PRs to master ([#3485](https://github.com/nf-core/tools/pull/3485))
- Add .nftignore to trigger list ([#3508](https://github.com/nf-core/tools/pull/3508))
- run nf-test tests on runsOn runners ([#3525](https://github.com/nf-core/tools/pull/3525))
- Include the centralized nf-core configs also in offline mode, if a local copy is available. ([#3491](https://github.com/nf-core/tools/pull/3491))

### Linting
Expand Down
26 changes: 21 additions & 5 deletions nf_core/pipeline-template/.github/workflows/nf-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,15 @@ env:

jobs:
nf-test-changes:
name: nf-test-changes
runs-on: ${{ github.event.inputs.runners || github.run_number > 1 && 'ubuntu-latest' || 'self-hosted' }}
name: nf-test-changes{% endraw %}
{%- if is_nfcore %}
runs-on:
- runs-on={% raw %}${{ github.run_id }}{% endraw %}-nf-test-changes
- runner=4cpu-linux-x64
{%- else %}
runs-on: "ubuntu-latest"
{%- endif -%}
{% raw %}
outputs:
shard: ${{ steps.set-shards.outputs.shard }}
total_shards: ${{ steps.set-shards.outputs.total_shards }}
Expand Down Expand Up @@ -73,7 +80,9 @@ jobs:
echo ${{ steps.set-shards.outputs.total_shards }}

nf-test:
runs-on: ${{ github.event.inputs.runners || github.run_number > 1 && 'ubuntu-latest' || 'self-hosted' }}
runs-on:
- runs-on=${{ github.run_id }}-nf-test-changes
- runner=4cpu-linux-x64
name: "${{ matrix.profile }} | ${{ matrix.NXF_VER }} | ${{ matrix.shard }}/${{ needs.nf-test-changes.outputs.total_shards }}"
needs: [nf-test-changes]
if: ${{ needs.nf-test-changes.outputs.total_shards != '0' }}
Expand Down Expand Up @@ -111,9 +120,16 @@ jobs:
with:
profile: ${{ matrix.profile }}
shard: ${{ matrix.shard }}
total_shards: ${{ env.TOTAL_SHARDS }}
total_shards: ${{ env.TOTAL_SHARDS }}{% endraw %}
confirm-pass:
runs-on: ${{ github.event.inputs.runners || github.run_number > 1 && 'ubuntu-latest' || 'self-hosted' }}
{%- if is_nfcore %}
runs-on:
- runs-on={% raw %}${{ github.run_id }}{% endraw %}-confirm-pass
- runner=4cpu-linux-x64
{%- else %}
runs-on: "ubuntu-latest"
{%- endif -%}
{% raw %}
needs: [nf-test]
if: always()
steps:
Expand Down
2 changes: 2 additions & 0 deletions nf_core/pipeline-template/tests/nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@
// TODO nf-core: Specify any additional parameters here
// Or any resources requirements
params.modules_testdata_base_path = 'https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/'

aws.client.anonymous = true // fixes S3 access issues on self-hosted runners
Loading