-
Notifications
You must be signed in to change notification settings - Fork 10
72 lines (62 loc) · 2.19 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
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