Add tests #96
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: nf-test | |
| on: | |
| push: | |
| paths-ignore: | |
| - "docs/**" | |
| - "**/meta.yml" | |
| - "**/*.md" | |
| - "**/*.png" | |
| - "**/*.svg" | |
| 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.2" | |
| NFT_WORKDIR: "~" | |
| NXF_ANSI_LOG: false | |
| NXF_SINGULARITY_CACHEDIR: ${{ github.workspace }}/.singularity | |
| NXF_SINGULARITY_LIBRARYDIR: ${{ github.workspace }}/.singularity | |
| jobs: | |
| find-tests: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| tags: ${{ steps.find.outputs.tags }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: get subworkflows | |
| id: find | |
| uses: ./.github/actions/find-tests | |
| - name: debug | |
| run: | | |
| echo ${{ steps.find.outputs.tags }} | |
| nf-test: | |
| name: "${{ matrix.tag }} | ${{ matrix.profile }} | ${{ matrix.NXF_VER }}" | |
| needs: [find-tests] | |
| runs-on: | |
| - "ubuntu-latest" | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| profile: [docker, singularity] | |
| tag: ${{ fromJson(needs.find-tests.outputs.tags) }} | |
| isMain: | |
| - ${{ github.base_ref == 'master' || github.base_ref == 'main' }} | |
| exclude: | |
| - isMain: false | |
| profile: "singularity" | |
| - isMain: false | |
| tag: "samplesheet_target_regions_null" | |
| NXF_VER: | |
| - "25.04.6" | |
| - "latest-everything" | |
| env: | |
| NXF_ANSI_LOG: false | |
| TOTAL_SHARDS: ${{ needs.nf-test-changes.outputs.total_shards }} | |
| steps: | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Clean up Disk space | |
| if: startsWith(matrix.tag, 'samplesheet') | |
| uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1 | |
| with: | |
| android: true | |
| dotnet: false | |
| haskell: false | |
| large-packages: false | |
| docker-images: false | |
| swap-storage: false | |
| - name: Run nf-test | |
| uses: ./.github/actions/nf-test | |
| env: | |
| NFT_WORKDIR: ${{ env.NFT_WORKDIR }} | |
| with: | |
| profile: ${{ matrix.profile }} | |
| tags: ${{ matrix.tag }} | |
| shard: 1 | |
| total_shards: 1 | |
| confirm-pass: | |
| needs: [nf-test] | |
| if: always() | |
| runs-on: | |
| - "ubuntu-latest" | |
| 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 "::group::DEBUG: \`needs\` Contents" | |
| echo "DEBUG: toJSON(needs) = ${{ toJSON(needs) }}" | |
| echo "DEBUG: toJSON(needs.*.result) = ${{ toJSON(needs.*.result) }}" | |
| echo "::endgroup::" | |
| - name: Clean Workspace | |
| if: always() | |
| run: | | |
| ls -la ./ | |
| rm -rf ./* || true | |
| rm -rf ./.??* || true | |
| ls -la ./ |