-
Notifications
You must be signed in to change notification settings - Fork 15
77 lines (75 loc) · 2.16 KB
/
pytest_codecov.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
name: pytest/codecov
on:
push:
# Only perform codecov if autometa or tests have changed...
paths:
- "autometa/**"
- "tests/**"
- "pytest.ini"
branches:
- main
- dev
pull_request:
# Only perform codecov if autometa or tests have changed...
paths:
- "autometa/**"
- "tests/**"
- "pytest.ini"
branches:
- main
- dev
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python-version: [3.8]
env:
OS: ${{ matrix.os }}
PYTHON: ${{ matrix.python-version }}
name: pytest & codecov
steps:
- uses: actions/checkout@v2
- name: Cache conda
uses: actions/cache@v2
with:
path: ~/conda_pkgs_dir
key: ${{ runner.os }}-conda-py${{ matrix.python-version }}-${{ hashFiles('tests/environment.yml') }}
- name: Cache test data
uses: actions/cache@v2
with:
path: tests/data/test_data.json
key: ${{ runner.os }}-test-data
- name: Setup mamba
uses: conda-incubator/setup-miniconda@v2
with:
python-version: ${{ matrix.python-version }}
mamba-version: "*"
channels: conda-forge,bioconda,defaults
channel-priority: true
activate-environment: autometa
environment-file: tests/environment.yml
- name: Conda config info
shell: bash -l {0}
run: |
conda info
conda list
conda config --show-sources
conda config --show
printenv | sort
- name: Download test data
shell: bash -l {0}
run: gdown https://drive.google.com/uc\?\id=1bSlPldaq3C6Cf9Y5Rm7iwtUDcjxAaeEk -O tests/data/test_data.json
- name: Install Autometa
shell: bash -l {0}
run: python -m pip install . --ignore-installed --no-deps -vv
- name: Run pytest
shell: bash -l {0}
run: python -m pytest --cov-report=xml --cov=autometa tests/
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
with:
env_vars: OS,PYTHON
flags: unittests
verbose: true