Skip to content

Commit 6054967

Browse files
author
Vianpyro
committed
Add GitHub Actions workflow for testing across multiple Python versions and OS
1 parent 635350c commit 6054967

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

.github/workflows/pytest.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Python package
2+
3+
on:
4+
push:
5+
null
6+
# branches:
7+
# - main
8+
pull_request:
9+
null
10+
11+
jobs:
12+
test:
13+
runs-on: ${{ matrix.os }}
14+
strategy:
15+
matrix:
16+
os: [ubuntu-latest, macos-latest, windows-latest]
17+
python-version: ["3.10", "3.11", "3.12", "3.13"]
18+
19+
steps:
20+
- name: Checkout code
21+
uses: actions/checkout@v4
22+
23+
- name: Set up Python
24+
uses: actions/setup-python@v5
25+
with:
26+
python-version: ${{ matrix.python-version }}
27+
cache: 'pip'
28+
run: pip install -r requirements.txt
29+
run: pip test
30+
31+
- name: Test with pytest
32+
run: |
33+
pip install pytest pytest-cov
34+
if [[ "${{ matrix.os }}" == "windows-latest" ]]; then
35+
python -m pytest --doctest-modules --junitxml=junit/test-results.xml --cov=com --cov-report=xml --cov-report=html
36+
else
37+
python3 -m pytest --doctest-modules --junitxml=junit/test-results.xml --cov=com --cov-report=xml --cov-report=html
38+
fi

0 commit comments

Comments
 (0)