-
Notifications
You must be signed in to change notification settings - Fork 40
43 lines (41 loc) · 1.39 KB
/
run_tests.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
name: Run tests
on: push
jobs:
test:
environment: actions
strategy:
fail-fast: false # still run the other versions of Python if one fails
matrix:
python: [3.8, 3.9, "3.10", 3.11]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Install coverage and pytest
run: pip install coverage==7.4.4 pytest==7.4.4
- name: Run tests
run: |
coverage run -m pytest -m "not regtest" -rw
coverage xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
with:
file: ./coverage.xml
name: codecov-umbrella
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
- name: Publish to PyPI
uses: casperdcl/deploy-pypi@v2
if: ${{ matrix.python == 3.9 }}
with:
password: ${{ secrets.PYPI_TOKEN }}
pip: wheel -w dist/ --no-deps .
# only upload if a tag is pushed (otherwise just build & check)
upload: ${{ github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') }}