Skip to content

Commit 0310dac

Browse files
committed
ci: add codecov
1 parent 1480aa2 commit 0310dac

File tree

5 files changed

+132
-16
lines changed

5 files changed

+132
-16
lines changed

.github/workflows/codecov.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: pre-commit
2+
3+
on:
4+
pull_request: null
5+
push:
6+
branches:
7+
- main
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
- name: Install uv
15+
uses: astral-sh/setup-uv@v4
16+
- name: Set up Python
17+
run: uv python install
18+
- name: Install the project
19+
run: uv sync --all-extras --dev
20+
- name: Run tests and generate coverage
21+
run: |
22+
uv run coverage run -m pytest
23+
uv run coverage xml
24+
- name: Upload coverage to Codecov
25+
uses: codecov/codecov-action@v5
26+
with:
27+
fail_ci_if_error: true
28+
files: ./coverage.xml
29+
flags: unittests
30+
name: codecov-umbrella
31+
token: ${{ secrets.CODECOV_TOKEN }}
32+
verbose: true

.github/workflows/pre-commit.yml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
name: pre-commit
2-
3-
on:
4-
pull_request:
2+
'on':
3+
pull_request: null
54
push:
6-
branches: [main]
7-
5+
branches:
6+
- main
87
jobs:
98
pre-commit:
109
runs-on: ubuntu-latest
1110
steps:
12-
- uses: actions/checkout@v4
13-
- uses: actions/setup-python@v5
14-
- uses: pre-commit/action@v3.0.1
11+
- uses: actions/checkout@v4
12+
- uses: actions/setup-python@v5
13+
- uses: pre-commit/action@v3.0.1

.pre-commit-config.yaml

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,22 @@
11
repos:
2-
- repo: https://github.com/pre-commit/pre-commit-hooks
2+
- repo: 'https://github.com/pre-commit/pre-commit-hooks'
33
rev: v5.0.0
44
hooks:
5-
- id: check-added-large-files
6-
- id: check-toml
7-
- id: end-of-file-fixer
8-
- id: trailing-whitespace
9-
- repo: https://github.com/codespell-project/codespell
5+
- id: check-added-large-files
6+
- id: check-toml
7+
- id: check-yaml
8+
- id: end-of-file-fixer
9+
- id: trailing-whitespace
10+
- repo: 'https://github.com/codespell-project/codespell'
1011
rev: v2.3.0
1112
hooks:
12-
- id: codespell
13-
- repo: https://github.com/astral-sh/ruff-pre-commit
13+
- id: codespell
14+
- repo: 'https://github.com/astral-sh/ruff-pre-commit'
1415
rev: v0.8.2
1516
hooks:
1617
- id: ruff
1718
- id: ruff-format
19+
- repo: 'https://github.com/adrienverge/yamllint'
20+
rev: v1.35.1
21+
hooks:
22+
- id: yamllint

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ dev = [
2323
"ipython==8.30.0",
2424
"pre-commit==4.0.1",
2525
"pytest==8.3.4",
26+
"pytest-cov==6.0.0"
2627
]
2728

2829
[build-system]

uv.lock

Lines changed: 79 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)