Optimized unit tests #62
Workflow file for this run
This file contains 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: Tests | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- ".github/workflows/unit-tests.yml" | |
- "tests/**" | |
- "mess/**" | |
- "setup.py" | |
- "!.github/workflows/build-docs.yml" | |
- "!docs/**" | |
- "!mkdocs.yml" | |
- "!README.md" | |
pull_request: | |
paths: | |
- ".github/workflows/unit-tests.yml" | |
- "tests/**" | |
- "mess/**" | |
- "setup.py" | |
- "!.github/workflows/build-docs.yml" | |
- "!docs/**" | |
- "!mkdocs.yml" | |
- "!README.md" | |
permissions: | |
contents: read | |
jobs: | |
tests: | |
name: "Python ${{ matrix.python-version }} on ${{ matrix.os }}" | |
runs-on: ${{ matrix.os }} | |
defaults: | |
run: | |
shell: bash -el {0} | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
python-version: ["3.12"] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup apptainer | |
uses: eWaterCycle/setup-apptainer@v2.0.0 | |
- name: Setup MeSS environment | |
uses: conda-incubator/setup-miniconda@v3 | |
with: | |
miniforge-version: latest | |
activate-environment: mess | |
python-version: ${{ matrix.python-version }} | |
auto-update-conda: true | |
- name: Install MeSS and pytest-cov | |
run: | | |
pip install -e . --no-build-isolation -vvv | |
pip install pytest coverage | |
- name: Cache apptainer containers | |
uses: actions/cache@v3 | |
with: | |
path: .snakemake/apptainer # Cache the Apptainer containers directory | |
key: ${{ runner.os }}-apptainer-${{ hashFiles('mess/workflow/envs/containers.yml') }} | |
restore-keys: | | |
${{ runner.os }}-apptainer- | |
- name: Run tests on ${{ matrix.os }} for python ${{ matrix.python-version }} | |
run: | | |
coverage run -m pytest |