Skip to content

Commit dcfbb56

Browse files
ci: coverage report fix (#198)
Configured the Jacoco plugin to specify the output directory for report generation. This change ensures that the report is consistently placed in the target directory for easier access and management.
1 parent 33c9513 commit dcfbb56

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

.github/workflows/checks.yaml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ jobs:
5353
steps:
5454
- name: Check out repository
5555
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
56+
with:
57+
fetch-depth: 0
5658
- uses: bufbuild/buf-setup-action@2211e06e8cf26d628cda2eea15c95f8c42b080b3
5759
with:
5860
github_token: ${{ secrets.GITHUB_TOKEN }}
@@ -62,11 +64,25 @@ jobs:
6264
java-version: "17"
6365
distribution: "temurin"
6466
server-id: github
67+
- name: Cache SonarCloud packages
68+
uses: actions/cache@v4
69+
with:
70+
path: ~/.sonar/cache
71+
key: ${{ runner.os }}-sonar
72+
restore-keys: ${{ runner.os }}-sonar
73+
- name: Cache Maven packages
74+
uses: actions/cache@v4
75+
with:
76+
path: ~/.m2
77+
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
78+
restore-keys: ${{ runner.os }}-m2
6579
- name: Maven Test Coverage
6680
env:
81+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
82+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6783
BUF_INPUT_HTTPS_USERNAME: opentdf-bot
6884
BUF_INPUT_HTTPS_PASSWORD: ${{ secrets.PERSONAL_ACCESS_TOKEN_OPENTDF }}
69-
run: mvn --batch-mode clean verify -P coverage
85+
run: mvn --batch-mode clean verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=opentdf_java-sdk -P coverage
7086

7187
platform-integration:
7288
runs-on: ubuntu-22.04

sdk/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,7 @@
297297
</goals>
298298
<configuration>
299299
<dataFile>${project.parent.basedir}/target/jacoco.exec</dataFile>
300+
<outputDirectory>${project.parent.basedir}/target/site/jacoco/</outputDirectory>
300301
<formats>
301302
<format>XML</format>
302303
</formats>

0 commit comments

Comments
 (0)