Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PF-3003: Add code coverage to sonar report #153

Merged
merged 3 commits into from
Jul 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/build-and-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

drive-by change, updated these to the current versions

- name: Set up JDK
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
Expand All @@ -37,17 +37,17 @@ jobs:
--health-retries 5
ports: [ "5432:5432" ]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up JDK
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: 'gradle'
- name: Run tests
run: ./gradlew test --scan
run: ./gradlew test --scan jacocoTestReport

# Run the Sonar scan after `gradle test` to include code coverage data in its report.
- name: Sonar scan
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=DataBiosphere_stairway&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=DataBiosphere_stairway)
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=DataBiosphere_stairway&metric=coverage)](https://sonarcloud.io/summary/new_code?id=DataBiosphere_stairway)

# Stairway
Stairway is a library that provides a framework for running _saga transactions_. Saga
transactions, introduced by Hector Garcia-Molina in 1987, use _compensating operations_ to
Expand Down
8 changes: 8 additions & 0 deletions buildSrc/src/main/groovy/stairway.java-conventions.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Java conventions common for all of the code
plugins {
id 'idea'
id 'jacoco'
id 'java'
id 'java-library'
id 'com.diffplug.spotless'
Expand Down Expand Up @@ -54,3 +55,10 @@ if (hasProperty("buildScan")) {
termsOfServiceAgree = "yes"
}
}

jacocoTestReport {
reports {
// sonar requires XML coverage output to upload coverage data
xml.required = true
}
}