-
-
Notifications
You must be signed in to change notification settings - Fork 521
83 lines (78 loc) · 1.87 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: Run tests
on:
push:
branches:
- main
pull_request:
branches:
- main
env:
WEBSOCKETS_TESTS_TIMEOUT_FACTOR: 10
jobs:
coverage:
name: Run test coverage checks
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Install Python 3.x
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Install tox
run: pip install tox
- name: Run tests with coverage
run: tox -e coverage
- name: Run tests with per-module coverage
run: tox -e maxi_cov
quality:
name: Run code quality checks
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Install Python 3.x
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Install tox
run: pip install tox
- name: Check code formatting
run: tox -e black
- name: Check code style
run: tox -e ruff
- name: Check types statically
run: tox -e mypy
matrix:
name: Run tests on Python ${{ matrix.python }}
needs:
- coverage
- quality
runs-on: ubuntu-latest
strategy:
matrix:
python:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
- "pypy-3.8"
- "pypy-3.9"
is_main:
- ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
exclude:
- python: "pypy-3.8"
is_main: false
- python: "pypy-3.9"
is_main: false
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Install Python ${{ matrix.python }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Install tox
run: pip install tox
- name: Run tests
run: tox -e py