From 92da537af9653eda72d12d2ef47bf735a1df36fe Mon Sep 17 00:00:00 2001 From: Patrick Dahlke Date: Fri, 7 Nov 2025 11:08:13 +0100 Subject: [PATCH 1/3] Add coverage workflow --- .github/workflows/coverage.yaml | 26 ++++++++++++++++++++++++++ .gitignore | 3 +++ Makefile | 4 ++++ pyproject.toml | 1 + 4 files changed, 34 insertions(+) create mode 100644 .github/workflows/coverage.yaml diff --git a/.github/workflows/coverage.yaml b/.github/workflows/coverage.yaml new file mode 100644 index 0000000..5b23c60 --- /dev/null +++ b/.github/workflows/coverage.yaml @@ -0,0 +1,26 @@ +name: Run tests and upload coverage + +on: + push + +jobs: + test: + name: Run tests and collect coverage + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Install uv + uses: astral-sh/setup-uv@v5 + + - name: uv sync + run: | + uv sync --all-group --all-extras + + - name: Run tests + run: uv run make coverage + + - name: Upload results to Codecov + uses: codecov/codecov-action@v5 + with: + token: ${{ secrets.CODECOV_TOKEN }} \ No newline at end of file diff --git a/.gitignore b/.gitignore index 8184c92..594bb3a 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,6 @@ _build .VSCodeCounter uv.lock + +.coverage +coverage.xml \ No newline at end of file diff --git a/Makefile b/Makefile index 74546a1..f1ba90c 100644 --- a/Makefile +++ b/Makefile @@ -14,6 +14,10 @@ test: test-matrix: nox +.PHONY: coverage +coverage: + pytest --cov --cov-branch --cov-report=xml + .PHONY: docs-html docs-html: make --directory docs/ clean && make --directory docs/ html diff --git a/pyproject.toml b/pyproject.toml index 814a705..bf0cab8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -32,6 +32,7 @@ test = [ "nox>=2025.2.9", "pytest-xdist", "pytest>=7.0", + "pytest-cov", "sphinx_design", "sphinxcontrib-plantuml", ] From 19c8af9894b6283b85f03b15d47729d39c4c389c Mon Sep 17 00:00:00 2001 From: Patrick Dahlke Date: Fri, 7 Nov 2025 11:09:33 +0100 Subject: [PATCH 2/3] Fix typo --- .github/workflows/coverage.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/coverage.yaml b/.github/workflows/coverage.yaml index 5b23c60..02d67f0 100644 --- a/.github/workflows/coverage.yaml +++ b/.github/workflows/coverage.yaml @@ -15,7 +15,7 @@ jobs: - name: uv sync run: | - uv sync --all-group --all-extras + uv sync --all-groups --all-extras - name: Run tests run: uv run make coverage From 50494a152b58f7d860767cd77258017c8847c737 Mon Sep 17 00:00:00 2001 From: Patrick Dahlke Date: Fri, 7 Nov 2025 11:12:00 +0100 Subject: [PATCH 3/3] Fix formatting --- .github/workflows/coverage.yaml | 5 ++--- .gitignore | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/coverage.yaml b/.github/workflows/coverage.yaml index 02d67f0..eb6a111 100644 --- a/.github/workflows/coverage.yaml +++ b/.github/workflows/coverage.yaml @@ -1,7 +1,6 @@ name: Run tests and upload coverage -on: - push +on: push jobs: test: @@ -23,4 +22,4 @@ jobs: - name: Upload results to Codecov uses: codecov/codecov-action@v5 with: - token: ${{ secrets.CODECOV_TOKEN }} \ No newline at end of file + token: ${{ secrets.CODECOV_TOKEN }} diff --git a/.gitignore b/.gitignore index 594bb3a..574ff48 100644 --- a/.gitignore +++ b/.gitignore @@ -23,4 +23,4 @@ _build uv.lock .coverage -coverage.xml \ No newline at end of file +coverage.xml