Check if code coverage works #5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Measure coverage | |
on: | |
pull_request: | |
env: | |
DIRECTORIES: "'Spring Boot 2 on Java' 'Spring Boot 2 on Kotlin'" | |
jobs: | |
check: | |
runs-on: ubuntu-latest | |
permissions: | |
pull-requests: write | |
strategy: | |
matrix: | |
java: [ 8 ] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup JDK | |
uses: actions/setup-java@v3 | |
with: | |
distribution: temurin | |
java-version: ${{ matrix.java }} | |
cache: 'gradle' | |
- name: Generate coverage report | |
run: | | |
for dir in ${{ env.DIRECTORIES }}; do | |
cd "$dir" | |
./gradlew jacocoTestReport | |
cd "${{ github.workspace }}" | |
done | |
- name: Add coverage report to PR | |
id: jacoco | |
uses: madrapps/[email protected] | |
with: | |
paths: ${{ github.workspace }}/**/build/reports/jacoco/**/jacocoTestReport.xml | |
token: ${{ secrets.GITHUB_TOKEN }} | |
title: Code Coverage | |
update-comment: true | |
# min-coverage-overall: 40 | |
# min-coverage-changed-files: 60 |