-
-
Notifications
You must be signed in to change notification settings - Fork 1
62 lines (55 loc) · 1.83 KB
/
make-coverage-html.yml
File metadata and controls
62 lines (55 loc) · 1.83 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
62
# 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:
HTML_REPORT_DIR: "algorithm-exercises-java/build/reports/jacoco/test/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
- name: Set up JDK
uses: actions/setup-java@v5
with:
java-version: 24
# Alternative distribution options are available
distribution: temurin
- name: Validate Gradle wrapper
uses: gradle/actions/wrapper-validation@v6
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v6
- name: Tool test
run: |
echo "Java version: ${{ matrix.java }}"
java -version
echo "OS: ${{ matrix.os }}"
echo "Gradle version:"
./gradlew --version
make --version
- name: Run coverage HTML target
run: make coverage/html
- name: Verify coverage HTML artifact
shell: bash
run: |
if [ ! -f $HTML_REPORT_DIR/index.html ]; then
echo "Coverage HTML file not found: $HTML_REPORT_DIR/index.html"
exit 1
fi
if [ ! -s $HTML_REPORT_DIR/index.html ]; then
echo "Coverage HTML file is empty: $HTML_REPORT_DIR/index.html"
exit 1
fi
- name: Upload coverage HTML artifact
uses: actions/upload-artifact@v7
with:
name: coverage-report-html
path: ${{ env.HTML_REPORT_DIR }}