Skip to content

Commit 48b3ce5

Browse files
committed
Add code coverage step to CI
1 parent a64bda0 commit 48b3ce5

File tree

1 file changed

+34
-19
lines changed

1 file changed

+34
-19
lines changed

.github/workflows/ci.yml

Lines changed: 34 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,17 @@ permissions:
2222

2323
jobs:
2424
build:
25+
runs-on: ubuntu-latest
26+
continue-on-error: false
2527
strategy:
2628
fail-fast: false
2729
matrix:
2830
include:
29-
- identifier: Java 25
30-
jdk: '25'
31-
primary_jdk: true
32-
- identifier: Java 21
33-
jdk: '21'
31+
- jdk: '21'
32+
33+
- jdk: '25'
34+
artifacts: primary
3435

35-
runs-on: ubuntu-latest
36-
continue-on-error: false
3736
steps:
3837

3938
- name: Checkout
@@ -53,22 +52,38 @@ jobs:
5352
- name: Build
5453
run: ./gradlew build
5554

55+
- name: Code Coverage
56+
if: ${{ matrix.artifacts == 'primary' }}
57+
uses: cicirello/jacoco-badge-generator@v2
58+
with:
59+
generate-branches-badge: true
60+
jacoco-csv-file: build/reports/jacoco/test/jacocoTestReport.csv
61+
intervals: 95, 90, 80, 70, 60, 0
62+
workflow-summary-heading: Test Coverage Summary
63+
fail-on-coverage-decrease: true
64+
fail-on-branches-decrease: true
65+
coverage-decrease-limit: 95
66+
branch-decrease-limit: 90
67+
5668
- name: Upload Reports Artifact
57-
uses: actions/upload-artifact@v4
69+
uses: actions/upload-artifact@v6
5870
with:
59-
name: reports-jdk${{ matrix.jdk }}
60-
path: ./build/reports/
71+
name: reports${{ matrix.artifacts == 'primary' && '' || format('-jdk{0}', matrix.jdk) }}
72+
path: |
73+
./build/reports/
74+
./.github/badges/**
6175
6276
- name: Upload API Documentation Artifact
63-
if: ${{ matrix.primary_jdk }}
64-
uses: actions/upload-artifact@v4
77+
if: ${{ matrix.artifacts == 'primary' }}
78+
uses: actions/upload-artifact@v6
6579
with:
66-
name: javadoc
67-
path: ./build/docs/javadoc
80+
name: javadoc
81+
path: ./build/docs/javadoc
82+
compression-level: 9
6883

69-
- name: Upload API Documentation Artifact
70-
if: ${{ matrix.primary_jdk }}
71-
uses: actions/upload-artifact@v4
84+
- name: Upload Binary Artifact
85+
if: ${{ matrix.artifacts == 'primary' }}
86+
uses: actions/upload-artifact@v6
7287
with:
73-
name: inet-time
74-
path: ./build/libs/*.jar
88+
name: inet-time
89+
path: ./build/libs/*.jar

0 commit comments

Comments
 (0)