Skip to content

Commit b938169

Browse files
simplify test workflow and add coverage reporting
1 parent f10ca72 commit b938169

2 files changed

Lines changed: 49 additions & 40 deletions

File tree

.github/workflows/ci.yml

Lines changed: 0 additions & 40 deletions
This file was deleted.

.github/workflows/tests.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: tests
2+
3+
on:
4+
pull_request:
5+
types:
6+
- opened
7+
- synchronize
8+
- reopened
9+
- ready_for_review
10+
push:
11+
branches:
12+
- main
13+
workflow_dispatch:
14+
15+
permissions: {}
16+
17+
concurrency:
18+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
19+
cancel-in-progress: true
20+
21+
jobs:
22+
test:
23+
strategy:
24+
fail-fast: false
25+
matrix:
26+
runs-on: ["ubuntu-latest"]
27+
python-version:
28+
- "3.11"
29+
- "3.12"
30+
- "3.13"
31+
- "3.14"
32+
coverage: [false]
33+
name: run tests (Python ${{ matrix.python-version }}, ${{ matrix.runs-on }})
34+
runs-on: ${{ matrix.runs-on }}
35+
steps:
36+
- uses: actions/checkout@v6
37+
with:
38+
persist-credentials: false
39+
- uses: actions/setup-python@v6
40+
with:
41+
python-version: ${{ matrix.python-version }}
42+
- run: pip install ".[test]" ${{ matrix.coverage && 'coverage pytest-cov' || '' }}
43+
- run: pytest ${{ matrix.coverage && '--cov' || '' }}
44+
- if: matrix.coverage
45+
name: report coverage to summary
46+
run: |
47+
coverage combine
48+
echo '## Coverage Report' >> $GITHUB_STEP_SUMMARY
49+
coverage report -i -m --format=markdown | tee -a $GITHUB_STEP_SUMMARY

0 commit comments

Comments
 (0)