Skip to content

Commit 37c0c30

Browse files
committed
ci: add GH workflow for testing and coverage in PR
1 parent 326a7a4 commit 37c0c30

1 file changed

Lines changed: 67 additions & 0 deletions

File tree

.github/workflows/tests.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: Tests
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
- main
8+
push:
9+
10+
jobs:
11+
test:
12+
runs-on: ${{ matrix.os }}
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
os: [ubuntu-latest, macos-latest, windows-latest]
17+
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']
18+
19+
steps:
20+
- uses: actions/checkout@v4
21+
22+
- name: Set up Python ${{ matrix.python-version }}
23+
uses: actions/setup-python@v5
24+
with:
25+
python-version: ${{ matrix.python-version }}
26+
27+
- name: Install dependencies
28+
run: |
29+
python -m pip install --upgrade pip
30+
pip install -r requirements-dev.txt
31+
32+
- name: Run tests with tox
33+
run: |
34+
tox -e py$(echo ${{ matrix.python-version }} | tr -d '.')
35+
36+
- name: Run flake8
37+
run: |
38+
flake8 --extend-ignore=E127 nodeenv.py tests setup.py
39+
40+
coverage:
41+
runs-on: ubuntu-latest
42+
steps:
43+
- uses: actions/checkout@v4
44+
45+
- name: Set up Python 3.14
46+
uses: actions/setup-python@v5
47+
with:
48+
python-version: '3.14'
49+
50+
- name: Install dependencies
51+
run: |
52+
python -m pip install --upgrade pip
53+
pip install -r requirements-dev.txt
54+
55+
- name: Run tests with coverage
56+
run: |
57+
coverage run -p -m pytest
58+
coverage report -m
59+
coverage html
60+
61+
- name: Upload coverage report
62+
uses: actions/upload-artifact@v4
63+
if: always()
64+
with:
65+
name: coverage-report
66+
path: coverage-html/
67+

0 commit comments

Comments
 (0)