-
Notifications
You must be signed in to change notification settings - Fork 6
67 lines (57 loc) · 1.73 KB
/
test.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
name: Tests
on: [push, pull_request]
jobs:
run_tests:
name: ${{ matrix.title }} (Python ${{ matrix.python }} on ${{ matrix.os }})
runs-on: ${{ matrix.os }}
env:
tox: tox
strategy:
fail-fast: false
matrix:
include:
- title: Codestyle and Main Tests
os: ubuntu-20.04
python: "3.10"
commands: |
$tox -e run-blackcheck,run-isortcheck
$tox -e py310-test
coverage: true
- title: Oldest supported Python
os: ubuntu-20.04
python: "3.7"
commands: $tox -e py37-test
coverage: true
- title: Windows
os: windows-latest
python: "3.9"
commands: tox -e py39-test
coverage: false
- title: MacOS
os: macos-latest
python: "3.11"
commands: $tox -e py311-test
coverage: true
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
name: Install Python ${{ matrix.python }}
with:
python-version: ${{ matrix.python }}
- name: Install required apt packages
if: runner.os == 'Linux'
run: sudo apt-get install pandoc
- name: Install Tox
run: pip install tox
- name: Run Commands
run: ${{ matrix.commands }}
- name: Convert coverage data to xml
if: matrix.coverage == true
shell: bash
run: |
runenv=$(echo "${{ matrix.python }}" | sed 's/\([2-3]\)\.\([0-9]*\)/py\1\2-runcmd/')
$tox -e $runenv -- python -m coverage xml
- uses: codecov/codecov-action@v1
if: matrix.coverage == true
with:
verbose: false