Feedback #49
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: | |
workflow_dispatch: | |
pull_request: | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ ubuntu-latest, macos-latest ] | |
permissions: | |
pull-requests: write | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: zulu | |
- name: Create Coverage Report | |
run: | | |
chmod +x gradlew | |
./gradlew jacocoTestReport | |
- if: matrix.os == 'ubuntu-latest' | |
name: Generate Jacoco Badge | |
uses: cicirello/[email protected] | |
with: | |
jacoco-csv-file: lib/build/jacoco/report.csv | |
badges-directory: .github/badges | |
generate-coverage-badge: true | |
coverage-badge-filename: jacoco.svg | |
- name: Commit the badges (if they changed) | |
run: | | |
if [[ `git diff --exit-code .github/badges` ]]; then | |
git config --global user.name 'qrutyy' | |
git config --global user.email '[email protected]' | |
git add .github/badges/* | |
git commit -m "ci: autogenerate JaCoCo coverage badge" | |
git push || true | |
fi | |
shell: bash |