-
Notifications
You must be signed in to change notification settings - Fork 60
60 lines (49 loc) · 1.66 KB
/
covergae.yml
File metadata and controls
60 lines (49 loc) · 1.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
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
title: Code Coverage
update-comment: true
pass-emoji: ':green_circle:'
ail-emoji: ':red_circle:'
- name: Get the Coverage info
run: |
echo "Total coverage ${{ steps.jacoco.outputs.coverage-overall }}"
echo "Changed Files coverage ${{ steps.jacoco.outputs.coverage-changed-files }}"
- name: Fail PR if coverage of changed files is less than 60%
if: ${{ steps.jacoco.outputs.coverage-changed-files < 43.0 }}
run: |
echo "Coverage of changed files is less than 60%!"
exit 1