Skip to content

Commit

Permalink
- Added GH wokflow for JaCoCo PR code coverage measuring.
Browse files Browse the repository at this point in the history
  • Loading branch information
miroslavpojer committed Dec 11, 2023
1 parent 9f93d78 commit ad1c885
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/ci-check-jacoco.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: CI check JaCoCo code-coverage

on:
pull_request:
branches: [ master ]

jobs:
test:
name: CI check JaCoCo code-coverage
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup Scala
uses: olafurpg/setup-scala@v10
with:
java-version: "adopt@1.8"
- name: Build and run tests
run: sbt jacoco
- name: Add coverage to PR
id: jacoco
uses: madrapps/jacoco-report@v1.3
with:
paths: >
${{ github.workspace }}/balta/target/scala-2.12/jacoco/report/jacoco.xml
token: ${{ secrets.GITHUB_TOKEN }}
min-coverage-overall: 0.0
min-coverage-changed-files: 80.0
title: JaCoCo code coverage report - balta
update-comment: true
debug-mode: 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%!')

0 comments on commit ad1c885

Please sign in to comment.