Skip to content

Commit 224f02b

Browse files
author
Gonzalo Diaz
committed
[Github Actions] new test for HTML coverage report generation
1 parent b120b99 commit 224f02b

1 file changed

Lines changed: 68 additions & 0 deletions

File tree

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# yamllint disable rule:line-length
2+
# This workflow runs make coverage/html and verifies that the coverage HTML report is generated.
3+
# yamllint enable rule:line-length
4+
5+
---
6+
name: Make Coverage HTML
7+
8+
env:
9+
REPORT_DIR: "./htmlcov/"
10+
REPORT_FILE: "index.html"
11+
12+
on: # yamllint disable-line rule:truthy
13+
push:
14+
branches: ["main"]
15+
pull_request:
16+
branches: ["main"]
17+
workflow_dispatch:
18+
19+
jobs:
20+
make-coverage-html:
21+
name: "Run make coverage/html and verify coverage HTML"
22+
runs-on: ubuntu-24.04
23+
24+
steps:
25+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
26+
with:
27+
fetch-depth: 0
28+
29+
- name: Setup Python
30+
uses: actions/setup-python@master
31+
with:
32+
python-version: 3.14
33+
34+
- name: Install tooling
35+
run: >
36+
sudo apt install pipenv
37+
38+
- name: Tooling check
39+
run: |
40+
python3 --version
41+
pipenv --version
42+
make --version
43+
44+
- name: Install
45+
run: |
46+
# Use the lockfile to install deterministic, audited dependencies
47+
pipenv sync --dev
48+
49+
- name: Run coverage HTML target
50+
run: make coverage/html
51+
52+
- name: Verify coverage HTML artifact
53+
shell: bash
54+
run: |
55+
if [ ! -f $REPORT_DIR/$REPORT_FILE ]; then
56+
echo "Coverage HTML file not found: $REPORT_DIR/$REPORT_FILE"
57+
exit 1
58+
fi
59+
if [ ! -s $REPORT_DIR/$REPORT_FILE ]; then
60+
echo "Coverage HTML file is empty: $REPORT_DIR/$REPORT_FILE"
61+
exit 1
62+
fi
63+
64+
- name: Upload coverage HTML artifact
65+
uses: actions/upload-artifact@v7
66+
with:
67+
name: coverage-report-html
68+
path: ${{ env.REPORT_DIR }}

0 commit comments

Comments
 (0)