feat: Enable pmd and jacoco #6
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: CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up JDK 21 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '21' | |
distribution: 'temurin' | |
- name: Build and test with Gradle | |
run: ./gradlew clean build jacocoTestCoverageVerification | |
env: | |
JAVA_HOME: ${{ steps.setup-java.outputs.java-home }} | |
- name: Upload code coverage report | |
if: success() || failure() # Make sure to run even if the previous step fails | |
uses: actions/upload-artifact@v3 | |
with: | |
name: jacoco-report | |
path: build/reports/jacoco/testCoverageVerification | |
- name: Check coverage report | |
if: failure() # Only run if the previous steps failed | |
run: | | |
echo "Coverage verification failed. Check the report for details." | |
cat build/reports/jacoco/testCoverageVerification/index.html |