-
Notifications
You must be signed in to change notification settings - Fork 0
81 lines (64 loc) · 1.79 KB
/
ci.yml
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
74
75
76
77
78
79
80
81
name: CI
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
env:
UV_SYSTEM_PYTHON: 1
jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v3
- name: Install dependencies
run: uv sync --all-extras
- name: Run pre-commit
uses: pre-commit/action@v3.0.1
test:
name: Test with ${{ matrix.python }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python: ["3.11", "3.12", "3.13"]
os: ["ubuntu-latest"]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v3
- name: Install dependencies
run: uv sync --all-extras --python ${{ matrix.python }}
- name: Test with pytest
run: uv run pytest
env:
COVERAGE_FILE: cov-${{ matrix.python }}${{ matrix.os }}.xml
- name: Save coverage report
uses: actions/upload-artifact@v4
with:
name: coverage-reports
path: cov-${{ matrix.python }}${{ matrix.os }}.xml
coverage-report:
name: Coverage report
runs-on: ubuntu-latest
needs: test
steps:
- name: Get coverage reports
uses: actions/download-artifact@v4
with:
name: coverage-reports
- name: Install uv
uses: astral-sh/setup-uv@v3
- name: Install dependencies
run: uv sync --all-extras
- name: Combine reports
run: coverage combine cov-*.xml --data-file cov.xml
- name: Upload coverage report to Codecov
uses: codecov/codecov-action@v4.0.1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./cov.xml