Skip to content

Commit

Permalink
run pytest workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
nebfield committed Jul 20, 2023
1 parent 229ca55 commit 3557ae9
Show file tree
Hide file tree
Showing 2 changed files with 110 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,40 @@ jobs:
cache-key: ${{ needs.preload_singularity.outputs.cache-key }}
singularity: true

pytest_workflow_docker:
needs: preload_docker
uses: ./.github/workflows/module.yml
strategy:
matrix:
tags:
- "test input check subworkflow"
- "test input check subworkflow with PGS catalog API"
- "test input check subworkflow with PGS catalog API and whitespace"
- "test make compatible subworkflow with bfile"
- "test make compatible subworkflow with vcf"
- "test make compatible subworkflow with pfile"
- "test input check subworkflow with liftover 38to37"
- "test input check subworkflow with liftover 37to38"
- "test apply score subworkflow"
- "test perfect apply score"
- "test combine scorefiles module"
- "test match module"
- "test match combine module"
- "plink2 testrelabelpvar"
- "plink2 testscore"
- "plink2 testsmallscore"
- "plink2 testmultiscore"
- "plink2 testsmallmultiscore"
- "plink2 testmultiscorefail"
- "plink2 vcf"
- "plink2 testrelabelbim"
- "pgscatalog test --pgs_id"
- "pgscatalog test --efo_trait --pgp_id and --pgs_id"
- "pgscatalog test bad accession"
- "pgscatalog test good and bad accessions GRCh38"
with:
cache-key: ${{ needs.preload_docker.outputs.cache-key }}
docker: true
tag: ${{ matrix.tags }}


73 changes: 73 additions & 0 deletions .github/workflows/module.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Run pytest-workflow

on:
workflow_call:
inputs:
cache-key:
type: string
required: true
docker:
type: boolean
singularity:
type: boolean
tag:
type: string
required: true

env:
NXF_SINGULARITY_CACHEDIR: ${{ github.workspace }}/singularity
SINGULARITY_VERSION: 3.8.3

jobs:
docker:
if: ${{ inputs.docker }}
runs-on: ubuntu-latest
strategy:
fail-fast: false

steps:
- name: Check out pipeline code
uses: actions/checkout@v3

- uses: nf-core/setup-nextflow@v1
with:
version: ${{ matrix.nxf_ver }}

- name: Restore docker images
if: matrix.profile == 'docker'
id: restore-docker
uses: actions/cache/restore@v3
with:
path: ${{ runner.temp }}/docker
key: ${{ inputs.cache-key }}

- name: Load docker images from cache
if: steps.restore-docker.outputs.cache-hit == 'true'
run: |
find $HOME -name '*.tar'
find ${{ runner.temp }}/docker/ -name '*.tar' -exec sh -c 'docker load < {}' \;
- name: Set up test requirements
uses: actions/setup-python@v3
with:
python-version: '3.10'
cache: 'pip'
- run: pip install -r ${{ github.workspace }}/tests/requirements.txt

- name: Run unit tests
run: TMPDIR=~ PROFILE=docker pytest --kwdof --symlink --git-aware --wt 2 --tag "${{ inputs.tag }}" --ignore tests/bin

- name: Upload logs on failure
if: failure()
uses: actions/upload-artifact@v2
with:
name: logs-docker-${{ inputs.tag }}
path: |
/home/runner/pytest_workflow_*/*/.nextflow.log
/home/runner/pytest_workflow_*/*/log.out
/home/runner/pytest_workflow_*/*/log.err
/home/runner/pytest_workflow_*/*/work
!/home/runner/pytest_workflow_*/*/work/conda
!/home/runner/pytest_workflow_*/*/work/singularity

0 comments on commit 3557ae9

Please sign in to comment.