code coverage report using Maven Quarkus JaCoco #5
This file contains hidden or 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: Java CI with Maven | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| pull_request: | |
| branches: [ "main" ] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| services: | |
| postgres: | |
| image: postgres:16 | |
| env: | |
| POSTGRES_DB: quarkus_test | |
| POSTGRES_USER: quarkus_test | |
| POSTGRES_PASSWORD: quarkus_test | |
| ports: | |
| - 5432:5432 | |
| options: >- | |
| --health-cmd="pg_isready -U quarkus_test" | |
| --health-interval=10s | |
| --health-timeout=5s | |
| --health-retries=5 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '17' | |
| distribution: 'temurin' | |
| cache: maven | |
| - name: Wait for PostgreSQL | |
| run: | | |
| until pg_isready -h localhost -p 5432 -U quarkus_test; do | |
| echo "Waiting for postgres..." | |
| sleep 2 | |
| done | |
| - name: Build & run tests with Jacoco | |
| run: mvn -B clean package verify | |
| - name: Upload Jacoco Report | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: jacoco-report | |
| path: target/jacoco-report |