forked from FasterXML/jackson-core
-
Notifications
You must be signed in to change notification settings - Fork 13
46 lines (41 loc) · 1.3 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
name: Maven tests
on:
pull_request:
push:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
java-flags:
- ""
- "-Xms512m -Xmx1024m"
- "-XX:+UseG1GC"
- "-XX:+UseParallelGC -XX:ParallelGCThreads=2"
- "-XX:+UseZGC"
- "-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=*:5005"
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: Set up JDK 17
uses: actions/setup-java@6a0805fcefea3d4657a47ac4c165951e33482018 # v4
with:
java-version: '17'
distribution: 'temurin'
cache: maven
- name: Run Maven tests with JVM flags
run: mvn verify -DargLine="@{argLine} ${{ matrix.jvm_flags }}"
- 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=81.58
if (( $(echo "$coverage - $threshold <= 0.1" | bc -l) )); then
echo "Coverage has not improved."
exit 1
else
echo "New coverage: $coverage%"
fi