diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1df9520e..9fc36af2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -26,7 +26,7 @@ jobs: java-version: '17' distribution: 'temurin' - run: chmod +x gradlew - - run: ./gradlew test + - run: ./gradlew test jacocoTestReport env: RINGCENTRAL_SERVER_URL: ${{ secrets.RINGCENTRAL_SERVER_URL }} RINGCENTRAL_CLIENT_ID: ${{ secrets.RINGCENTRAL_CLIENT_ID }} @@ -34,3 +34,8 @@ jobs: RINGCENTRAL_JWT_TOKEN: ${{ secrets.RINGCENTRAL_JWT_TOKEN }} RINGCENTRAL_SENDER: ${{ secrets.RINGCENTRAL_SENDER }} RINGCENTRAL_RECEIVER: ${{ secrets.RINGCENTRAL_RECEIVER }} + - name: View Report + uses: actions/upload-artifact@v4 + with: + name: jacoco-reports + path: build/jacocoHtml/ diff --git a/build.gradle b/build.gradle index e0e65bc4..e7d5a866 100644 --- a/build.gradle +++ b/build.gradle @@ -3,6 +3,7 @@ plugins { id 'maven-publish' id 'java-library' id 'signing' + id 'jacoco' } group 'com.ringcentral' @@ -13,6 +14,17 @@ sourceCompatibility = 1.8 repositories { mavenCentral() } +jacoco { + toolVersion = "0.8.11" +} + +jacocoTestReport { + reports { + xml.enabled true + html.enabled true + html.destination file("${buildDir}/jacocoHtml") + } +} dependencies { implementation group: 'com.google.code.gson', name: 'gson', version: '2.10.1' @@ -88,4 +100,5 @@ test { testLogging { exceptionFormat = 'full' } + finalizedBy jacocoTestReport }