Merge pull request #6772 from alvasw/fix_broken_codacy_coverage_reporter

Fix broken codacy coverage reporter
This commit is contained in:
Alejandro García 2023-07-17 18:27:48 +00:00 committed by GitHub
commit 1f809a1fb1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 31 additions and 23 deletions

30
.github/codacy-coverage-reporter.yml vendored Normal file
View File

@ -0,0 +1,30 @@
name: Codacy Coverage Reporter
on: ["push"]
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
name: codacy-coverage-reporter
steps:
- uses: actions/checkout@v3.5.3
- name: Set up JDK
uses: actions/setup-java@v3.11.0
with:
java-version: '15'
distribution: 'zulu'
- name: Build with Gradle
uses: gradle/gradle-build-action@v2.5.1
with:
arguments: build jacocoTestReport testCodeCoverageReport --scan
- 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 }}/code-coverage-report/build/reports/jacoco/testCodeCoverageReport/testCodeCoverageReport.xml

View File

@ -28,26 +28,4 @@ jobs:
- name: Build with Gradle
uses: gradle/gradle-build-action@v2.6.0
with:
arguments: build jacocoTestReport testCodeCoverageReport --scan
- name: Upload coverage report
uses: actions/upload-artifact@v3
with:
name: coverage-report
path: code-coverage-report/build/reports/jacoco/testCodeCoverageReport/testCodeCoverageReport.xml
publish_coverage:
name: Publish coverage
runs-on: ubuntu-latest
needs: build
steps:
- name: Download coverage report
uses: actions/download-artifact@v3
with:
name: coverage-report
path: code-coverage-report/build/reports/jacoco/testCodeCoverageReport
- 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 }}/code-coverage-report/build/reports/jacoco/testCodeCoverageReport/testCodeCoverageReport.xml
arguments: build --scan