Skip to content

docs: updating tutorial for COMBINE25 #2036

docs: updating tutorial for COMBINE25

docs: updating tutorial for COMBINE25 #2036

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'
- name: Log conda environment
# Log conda environment contents
shell: bash --login {0}
run: conda list
# Runs the test code and Snakemake workflow in the conda environment
test:
name: Run tests
# The Docker images will be pulled in both the docker job and this test job
runs-on: ${{ matrix.os }}
strategy:
matrix:
# We later use this with `pytest-split` to split our test CI into two
# (with the max specified by `--splits 2`), to save CI time by parallelization
test_group: [1, 2]
os: [ubuntu-latest]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- 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'
- name: Install spras in conda env
# Install spras in the environment using pip
shell: bash --login {0}
run: pip install .
- name: Log conda environment
# Log conda environment contents
shell: bash --login {0}
run: conda list
- name: Install Apptainer
# Formerly used Singularity instead of Apptainer (see https://github.com/eWaterCycle/setup-singularity/issues/6)
uses: eWaterCycle/setup-apptainer@v2
with:
# Choose version from https://github.com/apptainer/apptainer/releases
apptainer-version: 1.3.6
- name: Run tests
shell: bash --login {0}
# Verbose output and disable stdout and stderr capturing
# [this pytest-split workflow was borrowed from Snakemake CI]
run: pytest -vs --splits 2 --group ${{ matrix.test_group }}
workflow:
name: Run workflow
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
steps:
# TODO: is it worth it to make this setup into a composite action?
- name: Checkout repository
uses: actions/checkout@v4
- 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'
# Install spras in the environment using pip
- name: Install spras in conda env
shell: bash --login {0}
run: pip install .
- name: Run Snakemake workflow
shell: bash --login {0}
# We enable high parallelization (cores 4) to test our way out of the experienced
# race conditions from #268 and #279
# We also enforce strict DAG evaluation to catch DAG problems before they appear as user errors. (#359)
run: snakemake --cores 4 --configfile config/config.yaml --show-failed-logs --strict-dag-evaluation cyclic-graph --strict-dag-evaluation functions --strict-dag-evaluation periodic-wildcards
# 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: Install conda environment
uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: spras
environment-file: environment.yml
auto-activate-base: false
miniconda-version: 'latest'
- name: Run pre-commit
shell: bash --login {0}
# https://github.com/pre-commit/action/blob/576ff52938d158a24ac7e009dfa94b1455e7df99/action.yml#L19
run: pre-commit run --all-files --show-diff-on-failure --color=always