Bump eclipse-temurin from 21.0.2_13-jre-alpine to 22.0.1_8-jre-alpine #375
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
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven | |
name: Java CI with Maven | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout main branch | |
uses: actions/checkout@v4 | |
- name: Get required JDK version from Maven project | |
run: | | |
JDK_VERSION=$(mvn help:evaluate -Dexpression=maven.compiler.release -q -DforceStdout) | |
echo "JDK_VERSION=$JDK_VERSION" >> $GITHUB_ENV | |
- name: Checkout badges branch dedicated to storing badges only | |
uses: actions/checkout@v4 | |
with: | |
ref: badges | |
path: badges | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
java-version: ${{ env.JDK_VERSION }} | |
distribution: 'temurin' | |
cache: maven | |
- name: Build with Maven | |
run: mvn -B test --file pom.xml | |
- name: Generate JaCoCo Badge | |
id: jacoco | |
uses: cicirello/jacoco-badge-generator@v2 | |
with: | |
badges-directory: badges | |
generate-branches-badge: true | |
generate-summary: true | |
fail-if-coverage-less-than: 50 | |
fail-on-coverage-decrease: true | |
- name: Log coverage percentage(if it changed) | |
if: ${{ github.event_name == 'push' }} | |
run: | | |
echo "coverage = ${{ steps.jacoco.outputs.coverage }}" | |
echo "branch coverage = ${{ steps.jacoco.outputs.branches }}" | |
- name: Commit and push | |
if: ${{ github.event_name != 'pull_request' }} | |
run: | | |
cd badges | |
if [[ `git status --porcelain *.svg` ]]; then | |
git config --global user.name 'github-actions' | |
git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com' | |
git add *.svg | |
git commit -m "Autogenerated JaCoCo coverage badge" *.svg | |
git push | |
fi | |
# - name: Commit and push the badge (if it changed) | |
# if: ${{ github.event_name == 'push' }} | |
# uses: EndBug/add-and-commit@v8.0.2 | |
# with: | |
# default_author: github_actions | |
# message: 'commit badges' | |
# add: '*.svg' | |
- name: Upload JaCoCo coverage report | |
if: ${{ github.event_name == 'push' }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: jacoco-report | |
path: target/site/jacoco/ |