Skip to content

Commit 1695e6c

Browse files
committed
chg: add coverage and ci test
1 parent d95ae8b commit 1695e6c

3 files changed

Lines changed: 161 additions & 1 deletion

File tree

.github/workflows/test.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: CI
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
pull_request:
7+
8+
permissions: {}
9+
10+
jobs:
11+
pre-commit:
12+
runs-on: ubuntu-latest
13+
permissions:
14+
contents: read
15+
steps:
16+
- name: Checkout Code Repository
17+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
18+
with:
19+
persist-credentials: false
20+
21+
- name: Install the latest version of uv
22+
uses: astral-sh/setup-uv@e92bafb6253dcd438e0484186d7669ea7a8ca1cc # v6.4.3
23+
24+
- name: Install dependencies
25+
run: uv sync --frozen
26+
27+
- name: Run tests
28+
run: uv run coverage run -m pytest
29+
30+
- name: Generate coverage report
31+
run: uv run coverage xml
32+
33+
- name: Code Coverage Summary
34+
uses: insightsengineering/coverage-action@f3f8cdb7a8863fb60236982ac44b9ae63c768cd4
35+
with:
36+
path: coverage.xml
37+
threshold: 50
38+
fail: true
39+
publish: true
40+
diff: true
41+
uncovered-statements-increase-failure: false
42+
new-uncovered-statements-failure: false
43+
coverage-rate-reduction-failure: true
44+
token: ${{ github.token }}

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ dev = [
1111
"mkdocs>=1.6.1",
1212
"mkdocs-material>=9.7.1",
1313
"mkdocs-typer2>=0.1.6",
14-
"ty>=0.0.3"
14+
"ty>=0.0.3",
15+
"coverage>=7.13.5"
1516
]
1617

1718
[project]

0 commit comments

Comments
 (0)