Skip to content

Pc spring boot 3 final version #30

Pc spring boot 3 final version

Pc spring boot 3 final version #30

# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
name: "12-backend-jacoco: Java Test Coverage (Jacoco)"
on:
workflow_dispatch:
pull_request:
paths: [src/**, pom.xml, lombok.config]
push:
branches: [ main ]
paths: [src/**, pom.xml, lombok.config]
jobs:
build-jacoco-report:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v3.5.2
- name: Set up Java (version from .java-version file)
uses: actions/setup-java@v3
with:
distribution: semeru # See: https://github.com/actions/setup-java#supported-distributions
java-version-file: ./.java-version
- name: Build with Maven
env:
TEST_PROPERTIES: ${{ secrets.TEST_PROPERTIES }}
run: mvn -B test jacoco:report verify
- name: Get PR number
id: get-pr-num
run: |
echo "GITHUB_EVENT_PATH=${GITHUB_EVENT_PATH}"
pr_number=$(jq --raw-output .pull_request.number "$GITHUB_EVENT_PATH")
echo "pr_number=${pr_number}"
echo "pr_number=${pr_number}" >> "$GITHUB_ENV"
- name: Set path for github pages deploy when there is a PR num
if: ${{ env.pr_number != 'null' }}
run: |
prefix="prs/${pr_number}/"
echo "prefix=${prefix}"
echo "prefix=${prefix}" >> "$GITHUB_ENV"
- name: Set path for github pages deploy when there is NOT a PR num
if: ${{ env.pr_number == 'null' }}
run: |
prefix=""
echo "prefix=${prefix}"
echo "prefix=${prefix}" >> "$GITHUB_ENV"
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages # The branch the action should deploy to.
folder: target/site/jacoco # The folder where mvn puts the files
clean: true # Automatically remove deleted files from the deploy branch
target-folder: ${{env.prefix}}jacoco # The folder that we serve our files from