forked from MarginallyClever/Makelangelo-software
-
Notifications
You must be signed in to change notification settings - Fork 28
51 lines (41 loc) · 1.24 KB
/
test.yml
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
name: Java CI with Maven
on:
push:
pull_request:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
flag:
- { name: "MinHeapFreeRatio", value: "50" }
- { name: "PrintCompilation", value: "true"}
- { name: "UseParallelGC", value: "true" }
- { name: "GCTimeRatio", value: "20" }
- { name: "UseStringDeduplication", value: "true" }
- { name: "ThreadStackSize", value: "1024" }
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4.2.1
with:
distribution: 'temurin'
java-version: '17'
cache: 'maven'
- name: Build and Test with Maven
timeout-minutes: 15
run: ./mvnw -B verify
- name: Get JaCoCo Coverage
id: coverage
run: |
coverage=$(python3 config/coverage.py target/site/jacoco/jacoco.csv)
echo "COVERAGE=$coverage" >> $GITHUB_ENV
- name: Fail if coverage has not improved.
run: |
coverage=$COVERAGE
threshold=24.46
if (( $(echo "$coverage - $threshold <= 0.1" | bc -l) )); then
echo "Coverage is not improved."
exit 1
else
echo "New coverage: $coverage%. Coverage is improved!"
fi