testing github action #123
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: 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 | |