Add image QC and transcript QC subworkflow (ported from nf-xenium-processing dev HEAD) #1
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: Python tests | |
| # Runs the Python unit tests for the QC analysis scripts. | |
| # | |
| # The nf-test suites exercise the Nextflow layer, and the pipeline-level QC | |
| # tests run with `-stub`, so without this workflow none of the QC Python code is | |
| # ever executed in CI. | |
| # | |
| # The scripts import their heavy dependencies at module scope, so the tests need | |
| # a real runtime environment (matplotlib, tifffile, scanpy, ...), not a linting | |
| # environment. The env is therefore built from the QC modules' own | |
| # environment.yml files plus the test-only extras, which keeps every runtime pin | |
| # declared in exactly one place. | |
| on: | |
| push: | |
| branches: | |
| - dev | |
| - master | |
| pull_request: | |
| release: | |
| types: [published] | |
| env: | |
| NXF_ANSI_LOG: false | |
| concurrency: | |
| group: "${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}" | |
| cancel-in-progress: true | |
| jobs: | |
| pytest: | |
| name: Run Python tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out pipeline code | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
| - name: Set up the QC runtime environment | |
| uses: mamba-org/setup-micromamba@0dea6379afdaffa5d528b3d1dabc45da37f443fc # v2 | |
| with: | |
| environment-name: qc-tests | |
| # Runtime pins come from the modules themselves; only the test-only | |
| # extras live in bin/tests/environment.yml. | |
| environment-file: modules/local/image_qc/environment.yml | |
| create-args: >- | |
| --file modules/local/transcript_qc/environment.yml | |
| --file bin/tests/environment.yml | |
| cache-environment: true | |
| - name: Show environment | |
| shell: bash -el {0} | |
| run: | | |
| python --version | |
| python -c "import numpy, pandas, matplotlib, tifffile, scanpy; print('runtime imports OK')" | |
| - name: Run pytest | |
| shell: bash -el {0} | |
| run: pytest tests/ bin/tests/ -v -n auto |