-
Notifications
You must be signed in to change notification settings - Fork 69
73 lines (64 loc) · 1.7 KB
/
test.yml
File metadata and controls
73 lines (64 loc) · 1.7 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
name: Test
on:
pull_request:
paths:
- ".github/actions/setup-python-with-uv/action.yml"
- ".github/workflows/test.yml"
- "**.py"
- ".coveragerc"
- ".env**"
- ".python-version"
- "tests"
- "codecov.yaml"
- "pyproject.toml"
- "pytest.ini"
- "uv.lock"
push:
branches:
- develop
- main
paths:
- ".github/actions/setup-python-with-uv/action.yml"
- ".github/workflows/test.yml"
- "**.py"
- ".coveragerc"
- ".env**"
- ".python-version"
- "tests"
- "codecov.yaml"
- "pyproject.toml"
- "pytest.ini"
- "uv.lock"
permissions:
contents: read
jobs:
coverage:
runs-on: ubuntu-latest
steps:
- name: Generate a token
id: generate-token
uses: actions/create-github-app-token@v2
with:
app-id: ${{ vars.APP_ID }}
private-key: ${{ secrets.APP_KEY }}
- name: Checkout
uses: actions/checkout@v6
with:
token: ${{ steps.generate-token.outputs.token }}
- name: Setup Python with uv
uses: ./.github/actions/setup-python-with-uv
- name: Run pytest
run: uv run nox -s test -- --cov_report xml --junitxml junit.xml
- name: Upload test results to Codecov
uses: codecov/test-results-action@v1
with:
fail_ci_if_error: true
files: ./junit.xml,!./cache
token: ${{ secrets.CODECOV_TOKEN }}
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
fail_ci_if_error: true
flags: unittests
files: ./coverage.xml,!./cache
token: ${{ secrets.CODECOV_TOKEN }}