fix: jacoco does now produce a test report in the site folder #4
Workflow file for this run
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: Run Tests | |
on: | |
push: | |
pull_request: | |
types: [ opened, synchronize ] | |
workflow_dispatch: | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup JDK 18 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '18' | |
distribution: 'temurin' | |
cache: maven | |
- name: Build | |
run: | | |
mvn --batch-mode --update-snapshots clean package -DskipTests | |
- name: Test | |
run: | | |
mvn --batch-mode --update-snapshots test | |
- name: Publish coverage report to GitHub Pages | |
uses: JamesIves/github-pages-deploy-action@v4 | |
if: github.ref == 'refs/heads/main' | |
with: | |
BRANCH: gh-pages | |
folder: target/site/jacoco | |
target-folder: coverage-report/ | |
- name: Generate JaCoCo Badge | |
uses: cicirello/jacoco-badge-generator@v2 | |
if: github.ref == 'refs/heads/main' | |
with: | |
generate-branches-badge: true | |
badges-directory: build/reports/jacoco/test/html/badges | |
- name: Log coverage percentage | |
run: | | |
echo "coverage = ${{ steps.jacoco.outputs.coverage }}" | |
echo "branch coverage = ${{ steps.jacoco.outputs.branches }}" | |
- name: Publish coverage report to GitHub Pages | |
uses: JamesIves/github-pages-deploy-action@v4 | |
if: github.ref == 'refs/heads/main' | |
with: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
BRANCH: gh-pages | |
folder: build/reports/jacoco/test/html/badges | |
target-folder: badges/ |