Skip to content
Merged
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
33 changes: 15 additions & 18 deletions .github/workflows/check-jacoco.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,30 +31,27 @@ jobs:
scala: [ 2.11, 2.12 ]
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Setup Scala
uses: olafurpg/setup-scala@v10
with:
java-version: "adopt@1.8"
- name: Build and run tests
run: mvn clean verify -Pcode-coverage,scala-${{ matrix.scala }} --no-transfer-progress
- name: Add coverage to PR

- uses: actions/setup-python@v5
with:
python-version: '3.12'

- name: Add JaCoCo Report in PR comments
id: jacoco
uses: madrapps/jacoco-report@v1.3
uses: MoranaApps/jacoco-report@v0.2.1
with:
paths: ${{ github.workspace }}/target/site/jacoco/jacoco.xml
token: ${{ secrets.GITHUB_TOKEN }}
min-coverage-overall: 0.0
min-coverage-changed-files: 80.0
token: '${{ secrets.GITHUB_TOKEN }}'
paths: |
**/target/site/jacoco/jacoco.xml
title: JaCoCo code coverage report - Scala ${{ matrix.scala }}
update-comment: true
- name: Get the Coverage info
run: |
echo "Total coverage ${{ steps.jacoco.outputs.coverage-overall }}"
echo "Changed Files coverage ${{ steps.jacoco.outputs.coverage-changed-files }}"
- name: Fail PR if changed files coverage is less than 80%
if: ${{ steps.jacoco.outputs.coverage-changed-files < 80.0 }}
uses: actions/github-script@v6
with:
script: |
core.setFailed('Changed files coverage is less than 80%!')
sensitivity: "detail"
comment-mode: 'single'
min-coverage-overall: 75.0
min-coverage-changed-files: 80.0