CI: add gpu tag test job #48
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Run nf-tests | |
on: | |
push: | |
branches: | |
- dev | |
pull_request: | |
release: | |
types: [published] | |
workflow_dispatch: | |
inputs: | |
runners: | |
description: "Runners to test on" | |
type: choice | |
options: | |
- "ubuntu-latest" | |
- "self-hosted" | |
default: "ubuntu-latest" | |
# Cancel if a newer run is started | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# renovate: datasource=github-releases depName=askimed/nf-test versioning=semver | |
NFT_VER: "0.9.2" | |
NXF_ANSI_LOG: false | |
NXF_SINGULARITY_CACHEDIR: ${{ github.workspace }}/.singularity | |
NXF_SINGULARITY_LIBRARYDIR: ${{ github.workspace }}/.singularity | |
# renovate: datasource=github-releases depName=nextflow-io/nextflow versioning=semver | |
NXF_VER: "24.10.2" | |
jobs: | |
get-shards: | |
runs-on: ubuntu-latest | |
name: "Get Shards" | |
outputs: | |
shard: ${{ steps.set-shards.outputs.shard }} | |
total_shards: ${{ steps.set-shards.outputs.total_shards }} | |
steps: | |
- name: Check out pipeline code | |
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4 | |
with: | |
fetch-depth: 0 | |
- name: run nf-test-shard action | |
id: set-shards | |
uses: ./.github/actions/nf-test-shard | |
env: | |
NFT_VER: ${{ env.NFT_VER }} | |
with: | |
tags: "cpu" | |
max_shards: 15 | |
- name: Set outputs | |
id: set-outputs | |
run: | | |
echo "shard=${{ steps.set-shards.outputs.shard }}" >> $GITHUB_ENV | |
echo "total_shards=${{ steps.set-shards.outputs.total_shards }}" >> $GITHUB_ENV | |
nf-test: | |
needs: [get-shards] | |
runs-on: "ubuntu-latest" | |
name: "Test | ${{ matrix.profile }} | ${{ matrix.shard }} | ${{ matrix.NXF_VER }} | ${{ matrix.filters }}" | |
env: | |
NXF_VER: ${{ matrix.NXF_VER }} | |
# Only run on push if this is the nf-core dev branch (merged PRs) | |
if: "${{ github.event_name != 'push' || (github.event_name == 'push' && github.repository == 'nf-core/methylseq') }}" | |
strategy: | |
fail-fast: false | |
matrix: | |
profile: [conda, docker, singularity] | |
shard: ${{ fromJson(needs.get-shards.outputs.shard) }} | |
NXF_VER: | |
- "24.10.2" | |
filters: [pipeline] | |
steps: | |
- name: Check out pipeline code | |
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4 | |
with: | |
fetch-depth: 0 | |
- name: Run nf-test Action | |
uses: ./.github/actions/nf-test | |
with: | |
profile: ${{ matrix.profile }} | |
shard: ${{ matrix.shard }} | |
total_shards: ${{ needs.get-shards.outputs.total_shards }} | |
filters: ${{ matrix.filters }} | |
tags: "cpu" | |
confirm-pass: | |
runs-on: ubuntu-latest | |
needs: [nf-test] | |
if: always() | |
steps: | |
- name: One or more tests failed | |
if: ${{ contains(needs.*.result, 'failure') }} | |
run: exit 1 | |
- name: One or more tests cancelled | |
if: ${{ contains(needs.*.result, 'cancelled') }} | |
run: exit 1 | |
- name: All tests ok | |
if: ${{ contains(needs.*.result, 'success') }} | |
run: exit 0 | |
- name: debug-print | |
if: always() | |
run: | | |
echo "toJSON(needs) = ${{ toJSON(needs) }}" | |
echo "toJSON(needs.*.result) = ${{ toJSON(needs.*.result) }}" |