-
Notifications
You must be signed in to change notification settings - Fork 2
81 lines (78 loc) · 2.36 KB
/
check.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
78
79
80
81
name: check
on:
pull_request:
push:
branches:
- main
jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v2
- uses: actions/cache@v2
with:
path: |
~/.cache/pip
key: >-
${{ runner.os }} pip
${{ hashFiles('requirements-dev.txt', 'requirements-test.txt') }}
- run: |
python3 -m venv venv
source venv/bin/activate
python3 -m pip install -Ur requirements-dev.txt
- uses: pre-commit/action@v2.0.3
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
python-version:
- "3.5"
- "3.6"
- "3.7"
- "3.8"
- "3.9"
- "3.10"
- "3.11.0-alpha - 3.11"
- "pypy3"
include:
- python-version: "3.3"
os: ubuntu-18.04
- python-version: "3.4"
os: ubuntu-18.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- uses: actions/cache@v2
with:
path: |
~/.cache/pip
.tox
key: >-
${{ runner.os }} pip ${{ matrix.python-version }}
${{ hashFiles('requirements-test.txt', 'tox.ini') }}
- run: |
set -euxo pipefail
if [ "${{ matrix.python-version }}" = 3.3 ]; then
python3 -m pip install -U \
"tox<3" "pluggy<0.10" "setuptools<40" "virtualenv<15.2"
tox -e py33 # no support for --skip-missing-interpreters false
else
python3 -m pip install -U tox codecov
# We could use tox-gh-actions for this, but that'd result in
# a whole separate redundant section of versions to maintain;
# with this approach the matrix alone is enough.
tox --skip-missing-interpreters false -e py$(
# "s/^.* //" for cases like "3.10.0-alpha - 3.10"
echo "${{ matrix.python-version }}" | \
sed -e "s/^.* //" -e "s/\.//" -e s/^py//
)
codecov -X gcov
fi
env:
PYTEST_ADDOPTS: --color=yes
TOX_TESTENV_PASSENV: PYTEST_ADDOPTS