Skip to content

Commit 5dd5796

Browse files
mariotjabesq
andauthored
[tool] feat(ci): add codecov (#194)
Co-authored-by: Hugo Dupras <hugo.dupras@filigran.io>
1 parent 1ea278b commit 5dd5796

File tree

2 files changed

+47
-1
lines changed

2 files changed

+47
-1
lines changed

.github/workflows/coverage.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Coverage
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
test-and-print-coverage:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v6
19+
20+
- name: Setup uv
21+
uses: astral-sh/setup-uv@v8.0.0
22+
with:
23+
python-version: "3.12"
24+
25+
- name: Install dependencies
26+
run: |
27+
uv venv && uv pip install -e '.[dev]' coverage
28+
29+
- name: Run tests with coverage
30+
run: uv run coverage run -m unittest
31+
32+
- name: Print coverage summary
33+
run: uv run coverage report -m --fail-under=70
34+
35+
- name: Generate coverage XML
36+
run: uv run coverage xml -o coverage.xml
37+
38+
- name: Upload coverage to Codecov
39+
if: ${{ !cancelled() && hashFiles('coverage.xml') != '' }}
40+
uses: codecov/codecov-action@v5
41+
with:
42+
token: ${{ secrets.CODECOV_TOKEN }}
43+
flags: connectors
44+
fail_ci_if_error: false
45+
verbose: true

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ dev = [
5353
"types-pytz (>=2025.2.0.20250326,<2025.3.0.0)",
5454
"pre-commit (>=4.2.0,<4.3.0)",
5555
"types-python-dateutil (>=2.9.0,<2.10.0)",
56-
"wheel (>=0.45.1,<0.46.0)"
56+
"wheel (>=0.45.1,<0.46.0)",
57+
"coverage>=7.13.5"
5758
]
5859
doc = [
5960
"autoapi (>=2.0.1,<2.1.0)",

0 commit comments

Comments
 (0)