-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (52 loc) · 1.71 KB
/
conda-pytest.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
---
name: Pytest
on: [pull_request,workflow_dispatch]
jobs:
build-linux:
runs-on: ubuntu-latest
strategy:
max-parallel: 5
defaults:
run:
shell: bash -el {0}
steps:
- name: Remove docs before testing
run: rm -rf /github/workspace/docs
- name: Remove tutorials before testing
run: rm -rf /github/workspace/tutorials
- name: Remove archived code before testing
run: rm -rf /github/workspace/src/archive
- name: Fetch actions (v2)
uses: actions/checkout@v2
- name: Setup Conda
uses: conda-incubator/setup-miniconda@v2
with:
environment-file: requirements/testing.yml
activate-environment: test
auto-activate-base: false
- name: Conda info
run: |
conda info
conda list
- name: Lint with flake8
run: |
# activate the test environment
conda activate test
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor
# is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 \
--max-line-length=127 --statistics
- name: Test with pytest
run: |
conda activate test
pytest --cov-config=.coveragerc \
--cov=src --cov-report xml \
src/
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
env_vars: OS,PYTHON
verbose: true