Skip to content

Commit

Permalink
Fix broken codacy coverage reporter
Browse files Browse the repository at this point in the history
All PR CI runs fail due to the misconfigured codacy coverage reporter.
  • Loading branch information
alvasw committed Jul 17, 2023
1 parent bacc72d commit fe0b44e
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 23 deletions.
30 changes: 30 additions & 0 deletions .github/codacy-coverage-reporter.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]

- name: Set up JDK
uses: actions/[email protected]
with:
java-version: '15'
distribution: 'zulu'

- name: Build with Gradle
uses: gradle/[email protected]
with:
arguments: build jacocoTestReport testCodeCoverageReport --scan

- name: Run codacy-coverage-reporter
uses: codacy/[email protected]
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
coverage-reports: ${{ github.workspace }}/code-coverage-report/build/reports/jacoco/testCodeCoverageReport/testCodeCoverageReport.xml
24 changes: 1 addition & 23 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,26 +28,4 @@ jobs:
- name: Build with Gradle
uses: gradle/[email protected]
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/[email protected]
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
coverage-reports: ${{ github.workspace }}/code-coverage-report/build/reports/jacoco/testCodeCoverageReport/testCodeCoverageReport.xml
arguments: build --scan

0 comments on commit fe0b44e

Please sign in to comment.