Skip to content

Container workflow overhaul #732

Container workflow overhaul

Container workflow overhaul #732

Workflow file for this run

name: Test SPRAS
on: [push, pull_request]
jobs:
# Installs the conda environment but does not run tests because the tests require Linux Docker images
conda-only:
name: Test conda environment
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, windows-latest]
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install conda environment
uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: spras
environment-file: environment.yml
auto-activate-base: false
miniconda-version: 'latest'
# Log conda environment contents
- name: Log conda environment
shell: bash --login {0}
run: conda list
# Runs the test code and Snakemake workflow in the conda environment
test:
name: Run test cases and workflow
# The Docker images will be pulled in both the docker job and this test job
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install conda environment
uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: spras
environment-file: environment.yml
auto-activate-base: false
miniconda-version: 'latest'
# Log conda environment contents
- name: Log conda environment
shell: bash --login {0}
run: conda list
# Formerly used Singularity instead of Apptainer (see https://github.com/eWaterCycle/setup-singularity/issues/6)
- name: Install Apptainer
uses: eWaterCycle/setup-apptainer@v2
with:
# Choose version from https://github.com/apptainer/apptainer/releases
apptainer-version: 1.2.2
- name: Run tests
shell: bash --login {0}
# Verbose output and disable stdout and stderr capturing
run: pytest -vs
- name: Run Snakemake workflow
shell: bash --login {0}
run: snakemake --cores 2 --configfile config/config.yaml --show-failed-logs
# Run pre-commit checks on source files
pre-commit:
name: Run pre-commit checks
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.11' # Match this to the version specified in environment.yml
- name: Run pre-commit checks
uses: pre-commit/[email protected]