[Sync] Reorganize output directories + deduplicate snakefiles + bugfixes #8
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: test | |
# run unit and integration tests for the ProteinCartography package | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
# 'synchronize' means the PR was updated with new commits | |
types: [opened, reopened, labeled, synchronize] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
shell: bash -el {0} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup conda | |
uses: conda-incubator/setup-miniconda@v2 | |
with: | |
miniforge-variant: Mambaforge | |
miniforge-version: latest | |
python-version: "3.9" | |
use-mamba: true | |
activate-environment: test-env | |
auto-activate-base: false | |
# note: the docs claim `use-only-tar-bz2` must be set to true | |
# in order for package caching to work properly, | |
# but this results in many package-not-found errors, | |
# so we set it to false and do not use package caching | |
use-only-tar-bz2: false | |
- name: Cache the conda env | |
uses: actions/cache@v2 | |
id: cache-conda-env | |
with: | |
path: ${{ env.CONDA }}/envs | |
key: | |
conda-${{ runner.os }}--${{ runner.arch }}--${{ hashFiles('envs/cartography_test.yml') }} | |
- name: Create the conda env from which to run snakemake | |
run: | | |
mamba env update -n test-env -f envs/cartography_test.yml | |
if: steps.cache-conda-env.outputs.cache-hit != 'true' | |
- name: Cache the conda envs created by snakemake | |
uses: actions/cache@v2 | |
id: cache-snakemake-conda-envs | |
with: | |
path: .snakemake/conda | |
key: | |
conda-${{ runner.os }}--${{ runner.arch }}--${{ hashFiles('envs/*.yml') }} | |
- name: Create the snakemake conda envs | |
run: | | |
snakemake --configfile demo/search-mode/config_actin.yml --use-conda --conda-create-envs-only --cores 1 | |
if: steps.cache-snakemake-conda-envs.outputs.cache-hit != 'true' | |
- name: Run the tests | |
run: | | |
make test | |
- name: Run the tests without mocks | |
if: contains(github.event.pull_request.labels.*.name, 'run-slow-tests') | |
run: | | |
make test-without-mocks |