Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 64 additions & 0 deletions .github/workflows/make-coverage-html.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# yamllint disable rule:line-length
# This workflow runs make coverage/html and verifies that the coverage HTML report is generated.
# yamllint enable rule:line-length

---
name: Make Coverage HTML

on: # yamllint disable-line rule:truthy
push:
branches: ["main"]
pull_request:
branches: ["main"]
workflow_dispatch:

jobs:
make-coverage-html:
name: "Run make coverage/html and verify coverage HTML"
runs-on: ubuntu-24.04
steps:
- name: Checkout repository
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6

- name: Install/Adjust VCPKG
shell: bash
run: |
echo "VCPKG_ROOT=/usr/local/share/vcpkg" >> $GITHUB_ENV

- name: Install Tools
run: |
sudo apt-get update
sudo apt-get install lcov

- name: Check Tools
run: |
echo "-----------"
make --version
echo "-----------"
cmake --version
echo "-----------"
vcpkg --version
echo "-----------"
lcov --version
echo "-----------"

- name: Run coverage HTML target
run: make coverage/html

- name: Verify coverage HTML artifact
shell: bash
run: |
if [ ! -f coverage/index.html ]; then
echo "Coverage HTML file not found: coverage-report/index.html"
exit 1
fi
if [ ! -s coverage/index.html ]; then
echo "Coverage HTML file is empty: coverage-report/index.html"
exit 1
fi

- name: Upload coverage HTML artifact
uses: actions/upload-artifact@v7
with:
name: coverage-report
path: coverage
9 changes: 7 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,13 @@ coverage: test

coverage/html: coverage
genhtml ${COVERAGE_TOOL_OPTS} -o coverage/ --show-details --legend coverage/lcov.info
open coverage/index.html

@if [ "$$(uname)" = "Darwin" ]; then \
open coverage/index.html; \
elif [ "$$(uname | tr '[:upper:]' '[:lower:]')" = "mingw32" ] || [ "$$(uname | tr '[:upper:]' '[:lower:]')" = "mingw64" ] || [ "$$(uname | tr '[:upper:]' '[:lower:]')" = "cygwin" ]; then \
cmd /c start coverage/index.html; \
else \
echo "Coverage HTML generated: coverage/index.html"; \
fi
outdated:

update: dependencies outdated
Expand Down
Loading