File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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 }}
Original file line number Diff line number Diff line change @@ -143,7 +143,13 @@ coverage/xml: test
143143
144144coverage/html : test
145145 ${PACKAGE_TOOL} run coverage html
146- open htmlcov/index.html
146+ @if [ " $$ (uname)" = " Darwin" ]; then \
147+ open ./htmlcov/index.html; \
148+ elif [ " $$ (uname | tr '[:upper:]' '[:lower:]')" = " mingw32" ] || [ " $$ (uname | tr '[:upper:]' '[:lower:]')" = " mingw64" ] || [ " $$ (uname | tr '[:upper:]' '[:lower:]')" = " cygwin" ]; then \
149+ cmd /c start ./htmlcov/index.html; \
150+ else \
151+ echo " Coverage HTML generated: ./htmlcov/index.html" ; \
152+ fi
147153
148154# # Docker Compose commands
149155compose/build : env
You can’t perform that action at this time.
0 commit comments