-
Notifications
You must be signed in to change notification settings - Fork 1
82 lines (69 loc) · 2.1 KB
/
testing.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
73
74
75
76
77
78
79
80
81
82
name: testing
on:
pull_request:
push:
branches: [master]
jobs:
testing-pip:
name: Testing using pip
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Get pip cache dir
id: pip-cache
run: |
echo "::set-output name=dir::$(pip cache dir)"
- name: Cache pip files
uses: actions/cache@v2
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('setup.py') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-test.txt
- name: Test with pytest, generate coverage report
run: |
python -m pytest --cov=./
- name: Upload coverage report to CodeCov
uses: codecov/codecov-action@v1
testing-conda:
name: Testing using conda (mambaforge)
runs-on: ubuntu-latest
defaults:
run:
# https://github.com/conda-incubator/setup-miniconda#use-a-default-shell
shell: bash -l {0}
steps:
- uses: actions/checkout@v2
- name: Cache conda files
uses: actions/cache@v2
with:
path: |
~/conda_pkgs_dir
/opt/hostedtoolcache/Mambaforge
key:
${{ runner.os }}-mambaforge-${{ hashFiles('environment-test.yml') }}
restore-keys: |
${{ runner.os }}-mambaforge-
- name: Setup Miniconda (Mambaforge)
uses: conda-incubator/setup-miniconda@master
with:
activate-environment: incognita
environment-file: environment-test.yml
channel-priority: strict
# Mamba:
miniforge-variant: Mambaforge
miniforge-version: latest
use-mamba: true
# This needs to be set for caching to work properly
use-only-tar-bz2: true
- name: Test with pytest
run: |
python -m pytest