diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bf12e778..e83778da 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -30,9 +30,3 @@ jobs: with: name: cached-localnet path: .localnet - - uses: actions/upload-artifact@v3 - if: failure() - with: - name: gradlew-report - path: 'desktop/build/reports/tests/test/index.html' - retention-days: 30 diff --git a/.github/workflows/codacy-code-reporter.yml b/.github/workflows/codacy-code-reporter.yml new file mode 100644 index 00000000..152d2f9b --- /dev/null +++ b/.github/workflows/codacy-code-reporter.yml @@ -0,0 +1,28 @@ +name: Codacy Coverage Reporter + +on: ["push"] + +permissions: + contents: read + +jobs: + build: + name: Publish coverage + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Set up JDK 11 + uses: actions/setup-java@v3 + with: + java-version: '11' + distribution: 'adopt' + + - name: Build with Gradle + run: ./gradlew clean build -x checkstyleMain -x checkstyleTest -x shadowJar + + - name: Run codacy coverage reporter + uses: codacy/codacy-coverage-reporter-action@v1.3.0 + with: + project-token: ${{ secrets.CODACY_PROJECT_TOKEN }} + coverage-reports: ${{ github.workspace }}/build/reports/jacoco/testCodeCoverageReport/testCodeCoverageReport.xml diff --git a/build.gradle b/build.gradle index 6243cf60..2c12038e 100644 --- a/build.gradle +++ b/build.gradle @@ -28,6 +28,7 @@ configure(subprojects) { apply plugin: 'com.google.osdetector' // Apply the jacoco plugin to add support for test coverage apply plugin: 'jacoco' + apply plugin: 'jacoco-report-aggregation' apply plugin: 'checkstyle' sourceCompatibility = JavaVersion.VERSION_11 @@ -47,7 +48,7 @@ configure(subprojects) { grpcVersion = '1.42.1' gsonVersion = '2.8.5' guavaVersion = '30.1.1-jre' - guiceVersion = '4.2.2' + guiceVersion = '5.1.0' moneroJavaVersion = '0.8.0' httpclient5Version = '5.0' hamcrestVersion = '2.2' @@ -95,7 +96,7 @@ configure(subprojects) { checkstyle { toolVersion = '10.8.1' // https://raw.githubusercontent.com/checkstyle/checkstyle/checkstyle-10.8.1/src/main/resources/google_checks.xml - configFile = rootProject.file("${rootDir}/config/checkstyle/checkstyle.xml") + configFile = rootProject.file("$rootDir/config/checkstyle/checkstyle.xml") } tasks.withType(Checkstyle) { @@ -103,14 +104,20 @@ configure(subprojects) { maxHeapSize.set('1g') } - jacocoTestReport { - reports { - xml.required.set(true) - html.required.set(false) + jacoco { + toolVersion = "0.8.10" + reportsDirectory = file("$rootDir/build/reports/jacoco") + } + + test.finalizedBy { + testCodeCoverageReport { + // tests are required to run before generating the report + reports { + xml.required.set(true) + html.required.set(false) + } } } - // Codacy report generated with every build at assets/build/reports/jacoco/test/jacocoTestReport.xml - test.finalizedBy jacocoTestReport } configure([project(':cli'), diff --git a/gradle/verification-metadata.xml b/gradle/verification-metadata.xml index 0faa0f18..91681a9d 100644 --- a/gradle/verification-metadata.xml +++ b/gradle/verification-metadata.xml @@ -831,17 +831,9 @@ - - - - - - - - - - - + + + @@ -2376,48 +2368,24 @@ - - - - - - + + + - - - - - - + + + - - - + + + - - - - - - - - - - - - - - - - - - - - - + + + @@ -3145,76 +3113,14 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + @@ -3222,22 +3128,9 @@ - - - - - - - - - - - - - - - - + + + @@ -3245,6 +3138,11 @@ + + + + +