-
Notifications
You must be signed in to change notification settings - Fork 12
55 lines (51 loc) · 1.54 KB
/
Copy pathpython-package.yml
File metadata and controls
55 lines (51 loc) · 1.54 KB
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
# Install dependencies, lint, type-check, test, and publish results across
# Python versions.
# https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: Python package
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
workflow_dispatch:
permissions:
contents: read
checks: write # dorny/test-reporter publishes the JUnit results as a check run
pull-requests: write
jobs:
test:
name: make test (py${{ matrix.python-version }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
cache: pip
# make test runs markdownlint (npx) and pyright, which both run on Node.
- uses: actions/setup-node@v6
with:
node-version: "24"
- name: Install dependencies
run: make deps
- name: Lint, type-check, and test
run: make test
- name: Upload test reports
if: always()
uses: actions/upload-artifact@v7
with:
name: test-reports-py${{ matrix.python-version }}
path: |
junit.xml
htmlcov/
- name: Publish test results
uses: dorny/test-reporter@v3
if: success() || failure()
with:
name: Test Results (py${{ matrix.python-version }})
path: junit.xml
reporter: java-junit