feat: Testando Jacoco Report com Github Actions #6
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: Build with Maven | |
env: | |
KEYCLOAK_URL: https://keycloak-production-bdf6.up.railway.app/realms/educamotion | |
KEYCLOAK_CLIENT_ID: backend-service | |
KEYCLOAK_CLIENT_SECRET: ${{ secrets.KEYCLOAK_CLIENT_SECRET }} | |
GOOGLE_PROJECT_ID: project-id | |
GOOGLE_SERVICE_ACCOUNT_ENCODED_KEY: service-account-key | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
jobs: | |
build: | |
runs-on: ubuntu-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: 'temurin' | |
cache: maven | |
- name: Run coverage | |
run: mvn test | |
- name: Add coverage to PR | |
id: jacoco | |
uses: Madrapps/[email protected] | |
with: | |
paths: | | |
${{ github.workspace }}/target/jacoco-report/jacoco.xml | |
token: ${{ secrets.GITHUB_TOKEN }} | |
min-coverage-overall: 60 | |
min-coverage-changed-files: 80 |