Skip to content

Commit 0aba2c4

Browse files
committed
ci: add coverage summary to PR checks
- Add dedicated Coverage job that runs combined SQLite+Postgres coverage - Write coverage report output into GitHub Actions job summary - Upload htmlcov artifact for download Signed-off-by: phernandez <[email protected]>
1 parent 4dcac2f commit 0aba2c4

File tree

1 file changed

+55
-1
lines changed

1 file changed

+55
-1
lines changed

.github/workflows/test.yml

Lines changed: 55 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,4 +110,58 @@ jobs:
110110
- name: Run tests (Postgres via testcontainers)
111111
run: |
112112
uv pip install pytest pytest-cov
113-
just test-postgres
113+
just test-postgres
114+
115+
coverage:
116+
name: Coverage Summary (combined, Python 3.12)
117+
runs-on: ubuntu-latest
118+
119+
steps:
120+
- uses: actions/checkout@v4
121+
with:
122+
submodules: true
123+
124+
- name: Set up Python 3.12
125+
uses: actions/setup-python@v4
126+
with:
127+
python-version: "3.12"
128+
cache: "pip"
129+
130+
- name: Install uv
131+
run: |
132+
pip install uv
133+
134+
- name: Install just
135+
run: |
136+
curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | bash -s -- --to /usr/local/bin
137+
138+
- name: Create virtual env
139+
run: |
140+
uv venv
141+
142+
- name: Install dependencies
143+
run: |
144+
uv pip install -e .[dev]
145+
146+
- name: Run combined coverage (SQLite + Postgres)
147+
run: |
148+
uv pip install pytest pytest-cov
149+
just coverage
150+
151+
- name: Add coverage report to job summary
152+
if: always()
153+
run: |
154+
{
155+
echo "## Coverage"
156+
echo ""
157+
echo '```'
158+
uv run coverage report -m
159+
echo '```'
160+
} >> "$GITHUB_STEP_SUMMARY"
161+
162+
- name: Upload HTML coverage report
163+
if: always()
164+
uses: actions/upload-artifact@v4
165+
with:
166+
name: htmlcov
167+
path: htmlcov/

0 commit comments

Comments
 (0)