Skip to content

Commit 170872f

Browse files
authored
Refactor Python publish workflow for testing
1 parent e8ba9df commit 170872f

1 file changed

Lines changed: 49 additions & 0 deletions

File tree

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Python tests
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
13+
strategy:
14+
matrix:
15+
python-version: ["3.8", "3.9", "3.10", "3.11"]
16+
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@v4
20+
21+
- name: Set up Python
22+
uses: actions/setup-python@v5
23+
with:
24+
python-version: ${{ matrix.python-version }}
25+
26+
- name: Install Poetry
27+
run: |
28+
python -m pip install --upgrade pip
29+
pip install poetry
30+
31+
- name: Configure Poetry
32+
run: |
33+
poetry config virtualenvs.create true
34+
poetry config virtualenvs.in-project true
35+
36+
- name: Install dependencies
37+
run: |
38+
poetry install --with dev
39+
40+
- name: Run pytest
41+
run: |
42+
poetry run pytest
43+
44+
- name: Upload test reports
45+
if: always()
46+
uses: actions/upload-artifact@v4
47+
with:
48+
name: pytest-report-${{ matrix.python-version }}
49+
path: reports/

0 commit comments

Comments
 (0)