forked from neoforged/NeoGradle
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge test results prior to upload. Try setting up test reporting... check vs. test Adapted to how the TC build actually runs today Better displayed name. No JDK 8 from MS Testing GH workflow Testing GH workflow
- Loading branch information
Showing
2 changed files
with
71 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: 'Build Pull Request' | ||
run-name: Build for PR ${{ github.event.pull_request.number }} | ||
|
||
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 | ||
|
||
- 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 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: 'Test Report' | ||
on: | ||
workflow_run: | ||
workflows: ['Build Pull Request'] | ||
types: | ||
- completed | ||
permissions: | ||
contents: read | ||
actions: read | ||
checks: write | ||
jobs: | ||
report: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: dorny/test-reporter@v1 | ||
with: | ||
artifact: test-results | ||
name: Tests | ||
path: '**/*.xml' | ||
reporter: java-junit | ||
# This should not affect the result of the check created | ||
# for the origin PR. This just affects this post-processing job itself. | ||
fail-on-error: false | ||
fail-on-empty: false |