FIX: Fix and extend stub tests #1648
Workflow file for this run
This file contains hidden or 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-test on GPU | |
| on: | |
| pull_request: | |
| paths-ignore: | |
| - "docs/**" | |
| - "**/meta.yml" | |
| - "**/*.md" | |
| - "**/*.png" | |
| - "**/*.svg" | |
| release: | |
| types: [published] | |
| workflow_dispatch: | |
| # 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 }} | |
| NFT_VER: "0.9.3" | |
| # NFT_WORKDIR: "~" | |
| NXF_ANSI_LOG: false | |
| NXF_SINGULARITY_CACHEDIR: ${{ github.workspace }}/.singularity | |
| NXF_SINGULARITY_LIBRARYDIR: ${{ github.workspace }}/.singularity | |
| jobs: | |
| nf-test-gpu-changes: | |
| name: nf-test-gpu-changes | |
| runs-on: # use self-hosted runners | |
| - runs-on=${{ github.run_id }}-nf-test-gpu-changes | |
| - runner=4cpu-linux-x64 | |
| outputs: | |
| shard: ${{ steps.set-shards.outputs.shard }} | |
| total_shards: ${{ steps.set-shards.outputs.total_shards }} | |
| steps: | |
| - name: Clean Workspace # Purge the workspace in case it's running on a self-hosted runner | |
| run: | | |
| ls -la ./ | |
| rm -rf ./* || true | |
| rm -rf ./.??* || true | |
| ls -la ./ | |
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 | |
| with: | |
| fetch-depth: 0 | |
| - name: get number of shards | |
| id: set-shards | |
| uses: ./.github/actions/get-shards | |
| env: | |
| NFT_VER: ${{ env.NFT_VER }} | |
| with: | |
| tags: "gpu" | |
| max_shards: 2 | |
| - name: debug | |
| run: | | |
| echo ${{ steps.set-shards.outputs.shard }} | |
| echo ${{ steps.set-shards.outputs.total_shards }} | |
| nf-test-gpu: | |
| name: "GPU | ${{ matrix.profile }} | ${{ matrix.NXF_VER }} | ${{ matrix.shard }}/${{ needs.nf-test-gpu-changes.outputs.total_shards }}" | |
| needs: [nf-test-gpu-changes] | |
| if: ${{ needs.nf-test-gpu-changes.outputs.total_shards != '0' }} | |
| runs-on: "runs-on=${{ github.run_id }}/family=g4dn.xlarge/image=ubuntu24-gpu-x64" | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| shard: ${{ fromJson(needs.nf-test-gpu-changes.outputs.shard) }} | |
| # Note: at the moment, in sarek no processes using gpu are supported with conda | |
| # Which is why the profile matrix is limited to docker and singularity | |
| profile: [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: | |
| - 25.10.2 | |
| - latest-everything | |
| env: | |
| NXF_ANSI_LOG: false | |
| TOTAL_SHARDS: ${{ needs.nf-test-gpu-changes.outputs.total_shards }} | |
| steps: | |
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 | |
| with: | |
| fetch-depth: 0 | |
| - name: Test CUDA | |
| run: | | |
| nvidia-smi -L | |
| - name: Set NFT_WORKDIR dynamically | |
| run: echo "NFT_WORKDIR=$HOME" >> $GITHUB_ENV | |
| - name: Run nf-test on GPU | |
| id: run_nf_test_gpu | |
| uses: ./.github/actions/nf-test | |
| continue-on-error: ${{ matrix.NXF_VER == 'latest-everything' }} | |
| env: | |
| NFT_WORKDIR: ${{ env.NFT_WORKDIR }} | |
| NXF_VERSION: ${{ matrix.NXF_VER }} | |
| SENTIEON_AUTH_MECH: "GitHub Actions - token" | |
| SENTIEON_ENCRYPTION_KEY: ${{ secrets.SENTIEON_ENCRYPTION_KEY }} | |
| SENTIEON_LICENSE_MESSAGE: ${{ secrets.SENTIEON_LICENSE_MESSAGE }} | |
| SENTIEON_LICSRVR_IP: ${{ secrets.SENTIEON_LICSRVR_IP }} | |
| with: | |
| profile: ${{ matrix.profile }} | |
| shard: ${{ matrix.shard }} | |
| total_shards: ${{ env.TOTAL_SHARDS }} | |
| tags: ${{ matrix.profile == 'conda' && 'gpu_conda' || 'gpu,gpu_conda' }} | |
| - name: Report test status | |
| if: ${{ always() }} | |
| run: | | |
| if [[ "${{ steps.run_nf_test_gpu.outcome }}" == "failure" ]]; then | |
| echo "::error::Test with ${{ matrix.NXF_VER }} failed" | |
| # Add to workflow summary | |
| echo "## ❌ Test failed: ${{ matrix.profile }} | ${{ matrix.NXF_VER }} | Shard ${{ matrix.shard }}/${{ env.TOTAL_SHARDS }}" >> $GITHUB_STEP_SUMMARY | |
| if [[ "${{ matrix.NXF_VER }}" == "latest-everything" ]]; then | |
| echo "::warning::Test with latest-everything failed but will not cause workflow failure. Please check if the error is expected or if it needs fixing." | |
| fi | |
| if [[ "${{ matrix.NXF_VER }}" != "latest-everything" ]]; then | |
| exit 1 | |
| fi | |
| fi | |
| confirm-pass: | |
| needs: [nf-test-gpu] | |
| if: always() | |
| runs-on: # use self-hosted runners | |
| - runs-on=${{ github.run_id }}-confirm-pass | |
| - runner=2cpu-linux-x64 | |
| steps: | |
| - name: One or more tests failed (excluding latest-everything) | |
| 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 "::group::DEBUG: `needs` Contents" | |
| echo "DEBUG: toJSON(needs) = ${{ toJSON(needs) }}" | |
| echo "DEBUG: toJSON(needs.*.result) = ${{ toJSON(needs.*.result) }}" | |
| echo "::endgroup::" |