Skip to content

Commit dd7335f

Browse files
ptomanRHclaude
andcommitted
ci: onboard Codecov for unit test coverage tracking
- Add Codecov upload step with OIDC auth and unit-tests flag - Add permissions: id-token: write for OIDC token - Add codecov.yml with informational status checks and carryforward - Scope coverage to hand-written source via existing JaCoCo config Ref: COVERPORT-253 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 3b9c5e2 commit dd7335f

2 files changed

Lines changed: 38 additions & 4 deletions

File tree

.github/workflows/pr.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ jobs:
1313
permissions:
1414
checks: write
1515
pull-requests: write
16+
id-token: write
1617
env:
1718
MAIN_JAVA_VER: 21
1819
RUN_PYTHON_BIN: ${{ vars.RUN_PYTHON_BIN }}
@@ -66,9 +67,11 @@ jobs:
6667
./target/surefire-reports/*.xml
6768
./target/junit-platform/TEST-junit-jupiter.xml
6869
69-
- name: Upload coverage reports
70+
- name: Upload coverage to Codecov
7071
if: ${{ matrix.java == env.MAIN_JAVA_VER }}
71-
uses: actions/upload-artifact@v7
72+
uses: codecov/codecov-action@v5
7273
with:
73-
name: coverage-${{ matrix.java }}
74-
path: ./target/site/jacoco/jacoco.xml
74+
use_oidc: true
75+
flags: unit-tests
76+
files: ./target/site/jacoco/jacoco.xml
77+
slug: guacsec/trustify-da-java-client

codecov.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
codecov:
2+
require_ci_to_pass: false
3+
4+
comment:
5+
layout: "reach,diff,flags,components"
6+
behavior: default
7+
require_changes: false
8+
require_base: false
9+
require_head: true
10+
hide_project_coverage: false
11+
12+
coverage:
13+
status:
14+
project:
15+
default:
16+
informational: true
17+
patch:
18+
default:
19+
informational: true
20+
21+
flags:
22+
unit-tests:
23+
paths:
24+
- src/main/java/
25+
carryforward: true
26+
27+
ignore:
28+
- "src/test/"
29+
- "src/main/resources/"
30+
- "target/"
31+
- "docs/"

0 commit comments

Comments
 (0)