Skip to content

Commit

Permalink
CI: add gpu tag test job
Browse files Browse the repository at this point in the history
  • Loading branch information
sateeshperi committed Dec 2, 2024
1 parent 596a697 commit e03286f
Showing 1 changed file with 114 additions and 15 deletions.
129 changes: 114 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,119 @@ concurrency:
cancel-in-progress: true

jobs:
test:
name: "Run pipeline with test data (${{ matrix.NXF_VER }} | ${{ matrix.test_name }} | ${{ matrix.profile }})"
nf-test-changes:
name: nf-test-changes
runs-on: ubuntu-latest
outputs:
# Expose detected tags as 'modules' and 'workflows' output variables
paths: ${{ steps.list.outputs.components }}
modules: ${{ steps.outputs.outputs.modules }}
subworkflows: ${{ steps.outputs.outputs.subworkflows}}
# Prod for version bumping
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@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
fetch-depth: 0

- name: List nf-test files
id: list
run: |
COMPONENTS=$(nf-test list --tags | grep gpu)
echo "components=$COMPONENTS" >> $GITHUB_ENV
env:
components: ${{ steps.list.outputs.components }}

nf-test-gpu:
runs-on: "gpu"
name: "GPU | ${{ matrix.profile }} | ${{ matrix.shard }}"
needs: nf-test-changes
if: ${{ needs.nf-test-changes.outputs.components != '[]' }}
strategy:
fail-fast: false
matrix:
NXF_VER:
- "24.04.2"
- "latest-everything"
shard: [1, 2]
filter: [pipeline, workflow]
profile:
- "docker"
- "singularity"
isMaster:
- ${{ github.base_ref == 'master' }}
# Exclude conda and singularity on dev
exclude:
- isMaster: false
profile: "conda"
- isMaster: false
profile: "singularity"
env:
NXF_ANSI_LOG: false
TOTAL_SHARDS: 2

steps:
- name: Check out pipeline code
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4
with:
fetch-depth: 0

- name: Set up Nextflow
uses: nf-core/setup-nextflow@v2
with:
version: "${{ matrix.NXF_VER }}"

- name: Install pdiff to see diff between nf-test snapshots
run: |
python -m pip install --upgrade pip
pip install pdiff
- uses: nf-core/setup-nf-test@v1
with:
version: ${{ env.NFT_VER }}

- name: Set up Apptainer
if: matrix.profile == 'singularity'
uses: eWaterCycle/setup-apptainer@main

- name: Set up Singularity
if: matrix.profile == 'singularity'
run: |
mkdir -p $NXF_SINGULARITY_CACHEDIR
mkdir -p $NXF_SINGULARITY_LIBRARYDIR
- name: Clean up Disk space
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1

- name: Run GPU Tests (Shard ${{ matrix.shard }}/${{ strategy.job-total }})
run: |
nf-test test \
--ci \
--shard ${{ matrix.shard }}/${{ strategy.job-total }} \
--changed-since HEAD^ \
--profile "+${{ matrix.profile }}" \
--filter ${{ matrix.filter }} \
--tag "gpu"
- name: Output log on failure
if: failure()
run: |
sudo apt install bat > /dev/null
batcat --decorations=always --color=always ${{ github.workspace }}/.nf-test/tests/*/meta/nextflow.log
- name: Publish Test Report
uses: mikepenz/action-junit-report@v3
if: always() # always run even if the previous step fails
with:
report_paths: test.xml

nf-test:
name: "Run pipeline with test data (${{ matrix.NXF_VER }} | ${{ matrix.profile }})"
# 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') }}"
runs-on: ubuntu-latest
Expand All @@ -37,10 +148,9 @@ jobs:
shard: [1, 2, 3, 4, 5]
filter: [pipeline, workflow]
profile:
- "conda"
- "docker"
- "singularity"
test_name:
- "test"
isMaster:
- ${{ github.base_ref == 'master' }}
# Exclude conda and singularity on dev
Expand Down Expand Up @@ -106,17 +216,6 @@ jobs:
--profile "+${{ matrix.profile }}" \
--filter ${{ matrix.filter }}
- name: Run GPU Tests (Shard ${{ matrix.shard }}/${{ strategy.job-total }})
if: matrix.profile == 'docker' || matrix.profile == 'singularity'
run: |
nf-test test \
--ci \
--shard ${{ matrix.shard }}/${{ strategy.job-total }} \
--changed-since HEAD^ \
--profile "+${{ matrix.profile }}" \
--filter ${{ matrix.filter }} \
--tag "gpu"
- name: Output log on failure
if: failure()
run: |
Expand Down

0 comments on commit e03286f

Please sign in to comment.