Skip to content

Commit eaaa478

Browse files
kenibrewerclaude
andcommitted
♻️ refactor: migrate from custom coverage to orgoro/coverage action
- Replace custom coverage_report.py script with orgoro/[email protected] GitHub Action - Generate XML coverage format instead of JSON/LCOV for better action compatibility - Remove codecov action and custom GitHub API integration - Add coverage thresholds: 80% overall, 90% for new files - Remove custom coverage configuration from pyproject.toml - Update .gitignore to use coverage.xml format - Simplifies maintenance and provides better PR coverage reporting 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 7511463 commit eaaa478

File tree

5 files changed

+19
-122
lines changed

5 files changed

+19
-122
lines changed

.github/workflows/lib/.gitignore

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,16 @@ __pycache__/
1010
venv/
1111
env/
1212

13+
# uv cache
14+
.uv-cache/
15+
1316
# Testing & Coverage
1417
.pytest_cache/
1518
.coverage
1619
htmlcov/
1720
.tox/
1821
coverage/
19-
coverage.json
20-
coverage.lcov
22+
coverage.xml
2123

2224
# Build artifacts
2325
build/

.github/workflows/lib/pyproject.toml

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,3 @@ addopts = [
3838
"--disable-warnings",
3939
]
4040

41-
[tool.coverage.run]
42-
source = ["."]
43-
omit = [
44-
"tests/*",
45-
"coverage/*",
46-
"node_modules/*",
47-
]
48-
49-
[tool.coverage.report]
50-
exclude_lines = [
51-
"pragma: no cover",
52-
"def __repr__",
53-
"raise AssertionError",
54-
"raise NotImplementedError",
55-
]

.github/workflows/lib/tests/coverage_report.py

Lines changed: 0 additions & 88 deletions
This file was deleted.

.github/workflows/lib/uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/test-approval-automation.yml

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ jobs:
2727

2828
- name: Setup Python with uv
2929
uses: astral-sh/setup-uv@v4
30+
with:
31+
enable-cache: true
32+
cache-local-path: .github/workflows/lib/.uv-cache
3033

3134
- name: Install dependencies
3235
working-directory: .github/workflows/lib
@@ -38,24 +41,16 @@ jobs:
3841

3942
- name: Run tests with coverage
4043
working-directory: .github/workflows/lib
41-
run: uv run python -m pytest tests/ --cov=. --cov-report=json --cov-report=lcov --cov-report=html
42-
43-
- name: Upload coverage reports
44-
uses: codecov/codecov-action@v4
45-
if: success()
46-
with:
47-
file: .github/workflows/lib/coverage.lcov
48-
flags: approval-automation
49-
name: approval-automation-coverage
50-
fail_ci_if_error: false
44+
run: uv run python -m pytest tests/ --cov=. --cov-report=xml
5145

52-
- name: Comment coverage on PR
46+
- name: Python Coverage Comment
5347
if: github.event_name == 'pull_request' && success()
54-
working-directory: .github/workflows/lib
55-
env:
56-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
57-
GITHUB_CONTEXT: ${{ toJson(github) }}
58-
run: uv run python tests/coverage_report.py
48+
uses: orgoro/[email protected]
49+
with:
50+
coverageFile: .github/workflows/lib/coverage.xml
51+
token: ${{ secrets.GITHUB_TOKEN }}
52+
thresholdAll: 80
53+
thresholdNew: 90
5954

6055
validate-approval-logic:
6156
name: Validate Approval Logic
@@ -68,6 +63,9 @@ jobs:
6863

6964
- name: Setup Python with uv
7065
uses: astral-sh/setup-uv@v4
66+
with:
67+
enable-cache: true
68+
cache-local-path: .github/workflows/lib/.uv-cache
7169

7270
- name: Install dependencies
7371
working-directory: .github/workflows/lib

0 commit comments

Comments
 (0)