Skip to content

Commit b86ec28

Browse files
committed
Enable coverage
1 parent 89691e0 commit b86ec28

1 file changed

Lines changed: 23 additions & 7 deletions

File tree

.github/workflows/main.yml

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,45 @@
1-
name: Python Tests
2-
3-
on: [push]
4-
1+
name: Test
2+
on:
3+
pull_request:
4+
push:
5+
branches:
6+
- main
57

68
jobs:
79
test:
810
name: Run tests
11+
permissions:
12+
id-token: write
913
strategy:
1014
fail-fast: false
1115
matrix:
1216
platform: [ubuntu-latest, windows-latest]
1317
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
1418
runs-on: ${{ matrix.platform }}
1519
steps:
16-
- uses: actions/checkout@v4
20+
- uses: actions/checkout@v5
1721
- name: Install Python tools
1822
uses: BrandonLWhite/pipx-install-action@v1.0.3
1923
- name: Setup Python with poetry caching
2024
# poetry cache requires poetry to already be installed, weirdly
21-
uses: actions/setup-python@v5
25+
uses: actions/setup-python@v6
2226
with:
2327
python-version: ${{ matrix.python-version }}
2428
cache: poetry
2529

2630
- name: Test
2731
run: |-
2832
poetry install
29-
poe test
33+
poe test-with-coverage
34+
35+
- name: Upload test results to Codecov
36+
uses: codecov/test-results-action@v1
37+
with:
38+
token: ${{ secrets.CODECOV_TOKEN }}
39+
40+
- name: Upload code coverage
41+
uses: codecov/codecov-action@v5
42+
with:
43+
files: ./coverage.xml
44+
flags: ${{ matrix.platform}}_python${{ matrix.python-version }}
45+
use_oidc: ${{ !(github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork) }}

0 commit comments

Comments
 (0)