Merge pull request #152 from UweTrottmann/notes #121
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
name: Build and test | |
on: | |
push: | |
pull_request: | |
workflow_dispatch: # Allow running manually from web UI | |
jobs: | |
package: | |
name: Maven Build and Test | |
runs-on: ubuntu-latest | |
# Only run on pushes or if pull request from fork | |
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name | |
permissions: | |
checks: write # to publish unit test results | |
steps: | |
- name: Check out | |
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@6a0805fcefea3d4657a47ac4c165951e33482018 # v4.2.2 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
cache: 'maven' | |
- name: Build with Maven | |
run: mvn --batch-mode -show-version --update-snapshots --errors package | |
- name: Publish Unit Test Results | |
uses: dorny/test-reporter@31a54ee7ebcacc03a09ea97a7e5465a47b84aea5 # v1.9.1 | |
if: always() # also run if build step failed | |
with: | |
name: JUnit Report | |
path: target/surefire-reports/*.xml | |
reporter: java-junit |