merge #140
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: | |
jvm_flags: | |
- "-XX:+TieredCompilation" # Compiler flag | |
- "-Xmx4G" # Heap size flag: Maximal heap size of 4GB | |
- "-XX:+HeapDumpOnOutOfMemoryError" # Diagnostic | |
- "-XX:+UseG1GC" # Garbage collector flag: Use the G1 GC | |
- "-XX:+UseStringDeduplication" # Memory oprimization | |
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 |