Merge pull request #3 from fernando-alves/main #36
This file contains hidden or 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: run-tests | |
| on: [push] | |
| jobs: | |
| main-job: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event." | |
| - name: checkout | |
| uses: "actions/checkout@v2" | |
| - name: graalvm | |
| uses: DeLaGuardo/setup-graalvm@5.0 | |
| with: | |
| graalvm: '22.0.0.2' | |
| java: 'java17' | |
| arch: 'amd64' | |
| - run: java -version | |
| - name: Cache local Maven repository | |
| uses: actions/cache@v2 | |
| with: | |
| path: ~/.m2/repository | |
| key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-maven- | |
| - name: Cache docker layers | |
| uses: satackey/action-docker-layer-caching@v0.0.11 | |
| # Ignore the failure of a step and avoid terminating the job. | |
| continue-on-error: true | |
| - name: maven | |
| run: ./mvnw $SILENT clean test jacoco:report | |
| env: | |
| JAVA_OPTS: "-Xmx6g -Xms6g" | |
| SILENT: "-B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn" | |
| - name: Generate JaCoCo Badge | |
| uses: cicirello/jacoco-badge-generator@v2 | |
| with: | |
| generate-branches-badge: false | |
| - name: Commit the badge (if it changed) | |
| run: | | |
| if [[ `git status --porcelain` ]]; then | |
| git config --global user.name 'Julio Faerman' | |
| git config --global user.email 'faermanj@users.noreply.github.com' | |
| git add -A | |
| git commit -m "Autogenerated JaCoCo coverage badge" | |
| git push | |
| fi | |
| - name: Archive jacoco reports | |
| uses: actions/upload-artifact@v2 | |
| with: | |
| name: code-coverage-report | |
| path: target/site/** |