-
Notifications
You must be signed in to change notification settings - Fork 0
97 lines (78 loc) · 2.14 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
name: CI
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
env:
UV_FROZEN: 1
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
enable-cache: true
- name: Install dependencies
run: uv sync --all-extras
- name: Run Mypy
run: uv run mypy .
test:
name: Test Python ${{ matrix.python }}
runs-on: "ubuntu-latest"
strategy:
fail-fast: true
matrix:
python: ["3.11", "3.12", "3.13"]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
enable-cache: true
- name: Install dependencies
run: uv sync --all-extras --python ${{ matrix.python }}
- name: Run unit tests
run: uv run pytest -x
- name: Run integration tests
run: uv run pytest -x -m integration --cov-append
- name: Rename coverage report
run: mv .coverage .coverage.py${{ matrix.python }}
- name: Save coverage report
uses: actions/upload-artifact@v4
with:
name: coverage-${{ matrix.python }}
path: .coverage.py${{ matrix.python }}
include-hidden-files: true
coverage-report:
name: Coverage report
runs-on: ubuntu-latest
needs: [test]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Get coverage reports
uses: actions/download-artifact@v4
with:
pattern: coverage-*
merge-multiple: true
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
enable-cache: true
- name: Install dependencies
run: uv sync --all-extras
- name: Combine coverage reports
run: |
uv run coverage combine .coverage.*
uv run coverage xml -o cov.xml
- name: Upload coverage report to Codecov
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./cov.xml