-
-
Notifications
You must be signed in to change notification settings - Fork 1
61 lines (50 loc) · 1.49 KB
/
make-coverage-html.yml
File metadata and controls
61 lines (50 loc) · 1.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# 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
env:
REPORT_DIR: "./coverage/"
REPORT_FILE: "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:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: "1.26.x"
- name: Build
run: go build -v ./...
- name: Tool test
run: |
go version
make --version
- name: Run coverage HTML target
run: make coverage/html
- name: Verify coverage HTML artifact
shell: bash
run: |
if [ ! -f $REPORT_DIR/$REPORT_FILE ]; then
echo "Coverage HTML file not found: $REPORT_DIR/$REPORT_FILE"
exit 1
fi
if [ ! -s $REPORT_DIR/$REPORT_FILE ]; then
echo "Coverage HTML file is empty: $REPORT_DIR/$REPORT_FILE"
exit 1
fi
- name: Upload coverage HTML artifact
uses: actions/upload-artifact@v7
with:
name: coverage-report-html
path: ${{ env.REPORT_DIR }}