feat: add coverage action #9
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: | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
ref: 'petclinic-junit' | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v2 | |
with: | |
java-version: '17' | |
distribution: 'adopt' | |
maven-version: '3.8.4' | |
- name: Download and prepare Keploy binary | |
run: | | |
curl --silent --location 'https://github.com/keploy/keploy/releases/latest/download/keploy_linux_amd64.tar.gz' | tar xz -C /tmp | |
sudo mkdir -p /usr/local/bin && sudo mv /tmp/keploy /usr/local/bin/keploybin | |
- name: Build and test with Maven and Keploy | |
run: | | |
cd spring-petclinic/spring-petclinic-rest | |
mvn clean install -Dmaven.test.skip=true | |
mvn test | |
- name: Add coverage to PR | |
id: jacoco | |
uses: madrapps/jacoco-report@v1.6.1 | |
with: | |
paths: | | |
spring-petclinic/spring-petclinic-rest/target/site/e2e-ut-aggregate/jacoco.xml | |
token: ${{ secrets.GITHUB_TOKEN }} | |
min-coverage-overall: 40 | |
min-coverage-changed-files: 60 | |