-
Notifications
You must be signed in to change notification settings - Fork 3
68 lines (58 loc) · 1.58 KB
/
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
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
name: ci
on:
workflow_dispatch:
push:
branches:
- develop
- master
pull_request:
branches:
- develop
- master
jobs:
test:
name: run tests
runs-on: ubuntu-latest
strategy:
matrix:
# python versions match those in tox.ini
python-version: [3.7, 3.8, 3.9]
steps:
- name: Check out repo
uses: actions/checkout@v2
- name: Set up python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install tox-gh-actions dependencies
run: |
python -m pip install --upgrade pip
pip install tox tox-gh-actions
- name: Test with tox
run: tox
- name: Upload test results
if: always()
uses: actions/upload-artifact@v2
with:
name: Test Results (Python ${{ matrix.python-version }})
path: test-reports/test.xml
- name: Upload code coverage
if: matrix.python-version == '3.9'
uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}
publish-test-results:
name: Publish test results
needs: test
runs-on: ubuntu-latest
if: success() || failure()
steps:
- name: Download artifacts
uses: actions/download-artifact@v2
with:
path: artifacts
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
files: artifacts/**/*.xml