Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions .github/workflows/python.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
---
name: Python Checks for Pull Requests
on:
push:
branches:
- main
pull_request:
types:
- opened
Expand All @@ -27,9 +30,16 @@ jobs:
python-version: "3.9" # Same as in Dockerfile
- name: flake8 Lint
uses: py-actions/flake8@84ec6726560b6d5bd68f2a5bed83d62b52bb50ba # v2
- name: Run pytest
- name: Run pytest with coverage
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
export PATH="$HOME/.local/bin:$PATH"
uv sync --dev
uv run pytest
uv run pytest --cov=. --cov-report=xml:coverage.xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: unit-tests
files: coverage.xml
fail_ci_if_error: false
16 changes: 16 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
codecov:
require_ci_to_pass: yes

coverage:
precision: 2
round: down
range: "50...100"

flags:
unit-tests:
carryforward: true

comment:
layout: "reach,diff,flags,files"
behavior: default
15 changes: 15 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,19 @@ line-length = 95
dev = [
"black>=25.11.0",
"pytest>=8.4.2",
"pytest-cov>=6.0",
]

[tool.coverage.run]
omit = [
"**/test_*",
"**/tests/*",
".github/*",
"ci/*",
"scripts/*",
"templates/*",
"data/*",
]

[tool.coverage.report]
show_missing = true
Loading