Add JUnit support #108
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
name: Build Pull Request | |
on: | |
pull_request: | |
types: | |
- synchronize | |
- opened | |
- ready_for_review | |
- reopened | |
jobs: | |
build: | |
name: Build and Test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1000 | |
fetch-tags: true | |
# Switch to a new branch with the PR number and PR branch name, | |
# for the projects where the buildscript uses the branch name | |
- name: Create branch for commit | |
run: | |
git switch -C pr-${{ github.event.pull_request.number }}-${{ github.event.pull_request.head.ref }} | |
- name: Setup JDK | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'microsoft' | |
- name: Setup Gradle | |
uses: gradle/gradle-build-action@v2 | |
- name: Build | |
run: ./gradlew --info -s -x check build | |
- name: Test | |
run: ./gradlew --info -s check | |
# Always upload test results | |
- name: Merge Test Reports | |
if: success() || failure() | |
run: npx junit-report-merger junit.xml "**/TEST-*.xml" | |
- uses: actions/upload-artifact@v3 | |
if: success() || failure() | |
with: | |
name: test-results | |
path: junit.xml |