|
| 1 | +name: Run nf-test on ARM |
| 2 | +on: |
| 3 | + pull_request: |
| 4 | + paths-ignore: |
| 5 | + - "docs/**" |
| 6 | + - "**/meta.yml" |
| 7 | + - "**/*.md" |
| 8 | + - "**/*.png" |
| 9 | + - "**/*.svg" |
| 10 | + release: |
| 11 | + types: [published] |
| 12 | + workflow_dispatch: |
| 13 | + |
| 14 | +# Cancel if a newer run is started |
| 15 | +concurrency: |
| 16 | + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} |
| 17 | + cancel-in-progress: true |
| 18 | + |
| 19 | +env: |
| 20 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 21 | + NFT_VER: "0.9.3" |
| 22 | + NFT_WORKDIR: "~" |
| 23 | + NXF_ANSI_LOG: false |
| 24 | + NXF_SINGULARITY_CACHEDIR: ${{ github.workspace }}/.singularity |
| 25 | + NXF_SINGULARITY_LIBRARYDIR: ${{ github.workspace }}/.singularity |
| 26 | + |
| 27 | +jobs: |
| 28 | + nf-test-changes-arm: |
| 29 | + name: nf-test-changes-arm |
| 30 | + runs-on: # use self-hosted runners |
| 31 | + - runs-on=${{ github.run_id }}-nf-test-changes-arm |
| 32 | + - runner=4cpu-linux-arm64 |
| 33 | + outputs: |
| 34 | + shard: ${{ steps.set-shards.outputs.shard }} |
| 35 | + total_shards: ${{ steps.set-shards.outputs.total_shards }} |
| 36 | + steps: |
| 37 | + - name: Clean Workspace # Purge the workspace in case it's running on a self-hosted runner |
| 38 | + run: | |
| 39 | + ls -la ./ |
| 40 | + rm -rf ./* || true |
| 41 | + rm -rf ./.??* || true |
| 42 | + ls -la ./ |
| 43 | + - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5 |
| 44 | + with: |
| 45 | + fetch-depth: 0 |
| 46 | + |
| 47 | + - name: get number of shards |
| 48 | + id: set-shards |
| 49 | + uses: ./.github/actions/get-shards |
| 50 | + env: |
| 51 | + NFT_VER: ${{ env.NFT_VER }} |
| 52 | + # Skip sentieon tests - no ARM containers available |
| 53 | + SKIP_SENTIEON: true |
| 54 | + with: |
| 55 | + max_shards: 14 |
| 56 | + |
| 57 | + - name: debug |
| 58 | + run: | |
| 59 | + echo ${{ steps.set-shards.outputs.shard }} |
| 60 | + echo ${{ steps.set-shards.outputs.total_shards }} |
| 61 | +
|
| 62 | + nf-test-arm: |
| 63 | + name: "${{ matrix.profile }}-${{ matrix.archProfile }} | ${{ matrix.NXF_VER }} | ${{ matrix.shard }}/${{ needs.nf-test-changes-arm.outputs.total_shards }}" |
| 64 | + needs: [nf-test-changes-arm] |
| 65 | + if: ${{ needs.nf-test-changes-arm.outputs.total_shards != '0' }} |
| 66 | + runs-on: # use self-hosted runners |
| 67 | + - runs-on=${{ github.run_id }}-nf-test |
| 68 | + - runner=4cpu-linux-arm64 |
| 69 | + strategy: |
| 70 | + fail-fast: false |
| 71 | + matrix: |
| 72 | + shard: ${{ fromJson(needs.nf-test-changes-arm.outputs.shard) }} |
| 73 | + archProfile: [arm64] |
| 74 | + profile: [conda, docker, singularity] |
| 75 | + isMain: |
| 76 | + - ${{ github.base_ref == 'master' || github.base_ref == 'main' }} |
| 77 | + # Exclude conda and singularity on dev |
| 78 | + exclude: |
| 79 | + - isMain: false |
| 80 | + profile: "conda" |
| 81 | + - isMain: false |
| 82 | + profile: "singularity" |
| 83 | + NXF_VER: |
| 84 | + - "25.04.0" |
| 85 | + - "latest-everything" |
| 86 | + env: |
| 87 | + NXF_ANSI_LOG: false |
| 88 | + TOTAL_SHARDS: ${{ needs.nf-test-changes-arm.outputs.total_shards }} |
| 89 | + |
| 90 | + steps: |
| 91 | + - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5 |
| 92 | + with: |
| 93 | + fetch-depth: 0 |
| 94 | + |
| 95 | + - name: Run nf-test |
| 96 | + id: run_nf_test |
| 97 | + uses: ./.github/actions/nf-test |
| 98 | + continue-on-error: ${{ matrix.NXF_VER == 'latest-everything' }} |
| 99 | + env: |
| 100 | + NFT_WORKDIR: ${{ env.NFT_WORKDIR }} |
| 101 | + NXF_VERSION: ${{ matrix.NXF_VER }} |
| 102 | + # Skip sentieon tests - no ARM containers available |
| 103 | + SKIP_SENTIEON: true |
| 104 | + with: |
| 105 | + profile: ${{ matrix.profile }},${{ matrix.archProfile }} |
| 106 | + shard: ${{ matrix.shard }} |
| 107 | + total_shards: ${{ env.TOTAL_SHARDS }} |
| 108 | + |
| 109 | + - name: Report test status |
| 110 | + if: ${{ always() }} |
| 111 | + run: | |
| 112 | + if [[ "${{ steps.run_nf_test.outcome }}" == "failure" ]]; then |
| 113 | + echo "::error::Test with ${{ matrix.NXF_VER }} failed" |
| 114 | + # Add to workflow summary |
| 115 | + echo "## ❌ Test failed: ${{ matrix.profile }},${{ matrix.archProfile }} | ${{ matrix.NXF_VER }} | Shard ${{ matrix.shard }}/${{ env.TOTAL_SHARDS }}" >> $GITHUB_STEP_SUMMARY |
| 116 | + if [[ "${{ matrix.NXF_VER }}" == "latest-everything" ]]; then |
| 117 | + 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." |
| 118 | + fi |
| 119 | + if [[ "${{ matrix.NXF_VER }}" != "latest-everything" ]]; then |
| 120 | + exit 1 |
| 121 | + fi |
| 122 | + fi |
| 123 | +
|
| 124 | + confirm-pass-arm: |
| 125 | + needs: [nf-test-changes-arm, nf-test-arm] |
| 126 | + if: always() |
| 127 | + runs-on: # use self-hosted runners |
| 128 | + - runs-on=${{ github.run_id }}-confirm-pass |
| 129 | + - runner=2cpu-linux-x64 |
| 130 | + steps: |
| 131 | + - name: One or more tests failed (excluding latest-everything) |
| 132 | + if: ${{ contains(needs.*.result, 'failure') }} |
| 133 | + run: exit 1 |
| 134 | + |
| 135 | + - name: One or more tests cancelled |
| 136 | + if: ${{ contains(needs.*.result, 'cancelled') }} |
| 137 | + run: exit 1 |
| 138 | + |
| 139 | + - name: All tests ok |
| 140 | + if: ${{ contains(needs.*.result, 'success') }} |
| 141 | + run: exit 0 |
| 142 | + |
| 143 | + - name: debug-print |
| 144 | + if: always() |
| 145 | + run: | |
| 146 | + echo "::group::DEBUG: needs Contents" |
| 147 | + echo "DEBUG: toJSON(needs) = ${{ toJSON(needs) }}" |
| 148 | + echo "DEBUG: toJSON(needs.*.result) = ${{ toJSON(needs.*.result) }}" |
| 149 | + echo "::endgroup::" |
0 commit comments