maven: Bump cucumber.version from 7.18.0 to 7.18.1 #481
Workflow file for this run
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
# 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 | |
steps: | |
- name: Harden Runner | |
uses: step-security/harden-runner@0d381219ddf674d61a7572ddd19d7941e271515c # v2.9.0 | |
with: | |
egress-policy: audit | |
- id: checkout | |
name: checkout repository | |
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
- id: setupjava | |
name: Set up with Java 21 | |
uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1 | |
with: | |
distribution: 'temurin' | |
java-version: 21 | |
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@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4 | |
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 }} | |