Skip to content

Bump github/codeql-action from 3.27.9 to 3.28.0 #19

Bump github/codeql-action from 3.27.9 to 3.28.0

Bump github/codeql-action from 3.27.9 to 3.28.0 #19

Workflow file for this run

# Build and test a Java project with Maven, and compute and report test coverage
name: Java CI with Maven
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
permissions:
contents: read
jobs:
build:
name: building, testing and quality analysis
runs-on: ubuntu-latest
permissions:
# need write permissions for publishing the test report
checks: write
contents: write
steps:
- id: checkout
name: checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- id: setupjava
name: Set up with Java 23
uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.0
with:
distribution: 'temurin'
java-version: 23
cache: 'maven'
- id: mvn
name: Build with Maven (including running all tests)
run: mvn -B package --file pom.xml
- id: testreport
name: Publish Test Report
if: ${{ always() }}
uses: scacap/action-surefire-report@a2911bd1a4412ec18dde2d93b1758b3e56d2a880 # v1.8.0
- name: Generate JaCoCo Badge
id: jacoco
uses: cicirello/jacoco-badge-generator@f33476a5a3fd5a4f77cb5eef2ebe728c1dd5b921 # v2.11.0
with:
generate-coverage-badge: true
generate-branches-badge: true
generate-summary: true
- name: Log coverage percentage
run: |
echo "coverage = ${{ steps.jacoco.outputs.coverage }}"
echo "branch coverage = ${{ steps.jacoco.outputs.branches }}"
# - name: Commit and push the svg badges and the json coverage summary (if it changed)
# uses: EndBug/add-and-commit@a94899bca583c204427a224a7af87c02f9b325d5 # v9.1.4
# with:
# default_author: github_actions
# message: 'commit coverage badge and summary'
# add: '*.svg *.json'
#
# - name: Upload JaCoCo coverage report
# uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
# with:
# name: jacoco-report
# path: target/site/jacoco/
#
# - name: Comment on PR with coverage percentages
# if: ${{ github.event_name == 'pull_request' }}
# run: |
# REPORT=$(<.github/badges/coverage-summary.json)
# COVERAGE=$(jq -r '.coverage' <<< "$REPORT")%
# BRANCHES=$(jq -r '.branches' <<< "$REPORT")%
# NEWLINE=$'\n'
# BODY="## Test Coverage Summary ${NEWLINE}* __Coverage:__ ${COVERAGE}${NEWLINE}* __Branches:__ ${BRANCHES}"
# gh pr comment ${{github.event.pull_request.number}} -b "${BODY}"
# continue-on-error: true
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}