Skip to content

fix(trimgalore): clean stale outputs on same-workdir retry #18609

fix(trimgalore): clean stale outputs on same-workdir retry

fix(trimgalore): clean stale outputs on same-workdir retry #18609

Workflow file for this run

name: Run GPU nf-tests
on:
push:
branches:
# https://docs.renovatebot.com/key-concepts/automerge/#branch-vs-pr-automerging
- "renovate/**" # branches Renovate creates
paths-ignore:
- "**/meta.yml"
pull_request:
branches: [master]
paths-ignore:
- "**/meta.yml"
merge_group:
types: [checks_requested]
branches: [master]
paths-ignore:
- "**/meta.yml"
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 }}
# renovate: datasource=github-releases depName=askimed/nf-test versioning=semver
NFT_VER: "0.9.5"
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: "25.10.4"
jobs:
nf-test-changes:
name: nf-test-changes
runs-on:
- runs-on=${{ github.run_id }}-nf-test-changes-gpu
- runner=4cpu-linux-x64
- image=ubuntu22-full-x64
outputs:
# gpu tag outputs
gpu_paths: ${{ steps.list-gpu.outputs.components }}
gpu_shard: ${{ steps.shards-gpu.outputs.shard }}
gpu_total_shards: ${{ steps.shards-gpu.outputs.total_shards }}
# gpu_highmem tag outputs
gpu_highmem_paths: ${{ steps.list-gpu-highmem.outputs.components }}
gpu_highmem_shard: ${{ steps.shards-gpu-highmem.outputs.shard }}
gpu_highmem_total_shards: ${{ steps.shards-gpu-highmem.outputs.total_shards }}
steps:
- name: Clean Workspace
run: |
ls -la ./
rm -rf ./* || true
rm -rf ./.??* || true
ls -la ./
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
fetch-depth: 0
# Detect gpu and gpu_highmem tests separately
- name: List gpu test files
id: list-gpu
uses: adamrtalbot/detect-nf-test-changes@de3c3c8e113031b4f15a3c1104b5f135e8346997 # v0.0.6
with:
head: ${{ github.sha }}
base: ${{ github.event.pull_request.base.sha || github.event.merge_group.base_sha || 'origin/master' }}
n_parents: 0
tags: "gpu"
- name: List gpu_highmem test files
id: list-gpu-highmem
uses: adamrtalbot/detect-nf-test-changes@de3c3c8e113031b4f15a3c1104b5f135e8346997 # v0.0.6
with:
head: ${{ github.sha }}
base: ${{ github.event.pull_request.base.sha || github.event.merge_group.base_sha || 'origin/master' }}
n_parents: 0
tags: "gpu_highmem"
# Shard each tag independently
- name: Get gpu shards
id: shards-gpu
if: ${{ steps.list-gpu.outputs.components != '[]' }}
uses: ./.github/actions/get-shards
env:
NFT_VER: ${{ env.NFT_VER }}
with:
max_shards: 2
paths: "${{ join(fromJson(steps.list-gpu.outputs.components), ' ') }}"
tags: "gpu"
- name: Get gpu_highmem shards
id: shards-gpu-highmem
if: ${{ steps.list-gpu-highmem.outputs.components != '[]' }}
uses: ./.github/actions/get-shards
env:
NFT_VER: ${{ env.NFT_VER }}
with:
max_shards: 2
paths: "${{ join(fromJson(steps.list-gpu-highmem.outputs.components), ' ') }}"
tags: "gpu_highmem"
# Standard GPU tests (g4dn.xlarge - 4 vCPU, 16 GB RAM, T4 GPU)
# Runs tests tagged "gpu" (20+ modules: parabricks, amulety, cellpose, etc.)
nf-test-gpu:
runs-on: "runs-on=${{ github.run_id }}/family=g4dn.xlarge/image=ubuntu24-gpu-x64"
name: "GPU Test | g4dn.xlarge | ${{ matrix.profile }} | ${{ matrix.shard }}"
needs: [nf-test-changes]
if: ${{ needs.nf-test-changes.outputs.gpu_total_shards != '0' && needs.nf-test-changes.outputs.gpu_total_shards != '' }}
strategy:
fail-fast: false
matrix:
shard: ${{ fromJson(needs.nf-test-changes.outputs.gpu_shard) }}
profile: [docker, singularity]
env:
NXF_ANSI_LOG: false
TOTAL_SHARDS: ${{ needs.nf-test-changes.outputs.gpu_total_shards }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
fetch-depth: 0
- name: test cuda
run: |
nvidia-smi -L
- name: Run nf-test Action
uses: ./.github/actions/nf-test-action
env:
SENTIEON_ENCRYPTION_KEY: ${{ secrets.SENTIEON_ENCRYPTION_KEY }}
SENTIEON_LICENSE_MESSAGE: ${{ secrets.SENTIEON_LICENSE_MESSAGE }}
SENTIEON_LICSRVR_IP: ${{ secrets.SENTIEON_LICSRVR_IP }}
SENTIEON_AUTH_MECH: "GitHub Actions - token"
with:
profile: ${{ matrix.profile }},gpu
shard: ${{ matrix.shard }}
total_shards: ${{ env.TOTAL_SHARDS }}
paths: "${{ join(fromJson(needs.nf-test-changes.outputs.gpu_paths), ' ') }}"
tags: gpu
# High-memory GPU tests (g4dn.2xlarge - 8 vCPU, 32 GB RAM, T4 GPU)
# Runs tests tagged "gpu_highmem" (currently only parabricks/rnafq2bam,
# which requires >16 GB system RAM)
nf-test-gpu-highmem:
runs-on: "runs-on=${{ github.run_id }}/family=g4dn.2xlarge/image=ubuntu24-gpu-x64"
name: "GPU Test | g4dn.2xlarge | ${{ matrix.profile }} | ${{ matrix.shard }}"
needs: [nf-test-changes]
if: ${{ needs.nf-test-changes.outputs.gpu_highmem_total_shards != '0' && needs.nf-test-changes.outputs.gpu_highmem_total_shards != '' }}
strategy:
fail-fast: false
matrix:
shard: ${{ fromJson(needs.nf-test-changes.outputs.gpu_highmem_shard) }}
profile: [docker, singularity]
env:
NXF_ANSI_LOG: false
TOTAL_SHARDS: ${{ needs.nf-test-changes.outputs.gpu_highmem_total_shards }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
fetch-depth: 0
- name: test cuda
run: |
nvidia-smi -L
- name: Run nf-test Action
uses: ./.github/actions/nf-test-action
env:
SENTIEON_ENCRYPTION_KEY: ${{ secrets.SENTIEON_ENCRYPTION_KEY }}
SENTIEON_LICENSE_MESSAGE: ${{ secrets.SENTIEON_LICENSE_MESSAGE }}
SENTIEON_LICSRVR_IP: ${{ secrets.SENTIEON_LICSRVR_IP }}
SENTIEON_AUTH_MECH: "GitHub Actions - token"
with:
profile: ${{ matrix.profile }},gpu
shard: ${{ matrix.shard }}
total_shards: ${{ env.TOTAL_SHARDS }}
paths: "${{ join(fromJson(needs.nf-test-changes.outputs.gpu_highmem_paths), ' ') }}"
tags: gpu_highmem
confirm-pass-gpu:
runs-on:
- runs-on=${{ github.run_id }}-confirm-pass-gpu
- runner=2cpu-linux-x64
- image=ubuntu22-full-x64
needs: [nf-test-gpu, nf-test-gpu-highmem]
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') || (needs.nf-test-gpu.result == 'skipped' && needs.nf-test-gpu-highmem.result == 'skipped') }}
run: exit 0
- name: debug-print
if: always()
run: |
echo "toJSON(needs) = ${{ toJSON(needs) }}"
echo "toJSON(needs.*.result) = ${{ toJSON(needs.*.result) }}"