-
Notifications
You must be signed in to change notification settings - Fork 18
43 lines (34 loc) · 1.1 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
name: Run tests
env:
DEFAULT_PYTHON: 3.9
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
test:
name: Python ${{ matrix.python_version }}
runs-on: ubuntu-latest
env:
TOX_POSARGS: -- --cov=. --cov-report=xml
strategy:
matrix:
python_version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python_version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python_version }}
cache: "pip"
cache-dependency-path: "requirements.txt"
- name: Upgrade packaging tools
run: python -m pip install --upgrade pip setuptools wheel
- name: Install dependencies
run: python -m pip install --upgrade codecov tox
- name: Run tox targets for Python ${{ matrix.python_version }}
run: tox run -f py$(echo ${{ matrix.python_version }} | tr -d .) ${{ env.TOX_POSARGS }}
- name: Upload Coverage to Codecov
if: ${{ matrix.python_version == env.DEFAULT_PYTHON }}
uses: codecov/codecov-action@v4