Skip to content

Commit

Permalink
better pr decoration
Browse files Browse the repository at this point in the history
  • Loading branch information
turing85 committed Feb 21, 2023
1 parent ca11aa7 commit 33b00ca
Showing 1 changed file with 92 additions and 2 deletions.
94 changes: 92 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,20 @@ on:
- '.all-contributorsrc'

jobs:
recreate-comment:
runs-on: ubuntu-latest

steps:
- name: (Re-)create Comment
uses: marocchino/sticky-pull-request-comment@v2
if: ${{ github.event_name == 'pull_request' }}
with:
header: reports
message: |
## 🚦Reports🚦
Reports will be posted here as they get available.
recreate: true

generate-matrix:
runs-on: ubuntu-latest

Expand Down Expand Up @@ -163,6 +177,7 @@ jobs:
runs-on: ubuntu-latest

needs:
- recreate-comment
- build-and-test-jvm

steps:
Expand All @@ -175,12 +190,49 @@ jobs:
name: test-report-jvm

- name: JUnit Test Report
uses: dorny/test-reporter@v1
id: junit-report
uses: phoenix-actions/test-reporting@v10
with:
name: JUnit Test Report JVM
path: '**/target/surefire-reports/TEST*.xml'
reporter: java-junit

- name: Update PR status comment on success
uses: marocchino/sticky-pull-request-comment@v2
if: ${{ github.event_name == 'pull_request' && steps.junit-report.conclusion == 'success' }}
with:
header: reports
message: |
<details>
<summary><h3>🥳 JUnit tests passed</h3></summary>
|Passed|Failed|Skipped|
|----------|---------|-----------|
|✅ ${{ steps.junit-report.outputs.passed }}|❌ ${{ steps.junit-report.outputs.failed }}|⚠️ ${{ steps.junit-report.outputs.skipped }}|
You can see the JUnit report [here](${{ steps.junit-report.outputs.runHtmlUrl }}).
</details>
append: true

- name: Update PR status comment on failure
uses: marocchino/sticky-pull-request-comment@v2
if: ${{ github.event_name == 'pull_request' && steps.junit-report.conclusion != 'success' }}
with:
header: reports
message: |
<details>
<summary><h3>😔 JUnit JVM tests failed</h3></summary>
|Passed|Failed|Skipped|
|----------|---------|-----------|
|✅ ${{ steps.junit-report.outputs.passed }}|❌ ${{ steps.junit-report.outputs.failed }}|⚠️ ${{ steps.junit-report.outputs.skipped }}|
You can see the JUnit report [here](${{ steps.junit-report.outputs.runHtmlUrl }}).
</details>
append: true

- name: Cancel Build
if: ${{ failure() }}
uses: andymckay/[email protected]
Expand Down Expand Up @@ -242,6 +294,7 @@ jobs:
runs-on: ubuntu-latest

needs:
- recreate-comment
- build-and-test-native

steps:
Expand All @@ -254,12 +307,49 @@ jobs:
name: test-report-native

- name: JUnit Test Report
uses: dorny/test-reporter@v1
id: junit-report
uses: phoenix-actions/test-reporting@v10
with:
name: JUnit Test Report Native
path: '**/target/*-reports/TEST*.xml'
reporter: java-junit

- name: Update PR status comment on success
uses: marocchino/sticky-pull-request-comment@v2
if: ${{ github.event_name == 'pull_request' && steps.junit-report.conclusion == 'success' }}
with:
header: reports
message: |
<details>
<summary><h3>🥳 Native JUnit tests passed</h3></summary>
|Passed|Failed|Skipped|
|----------|---------|-----------|
|✅ ${{ steps.junit-report.outputs.passed }}|❌ ${{ steps.junit-report.outputs.failed }}|⚠️ ${{ steps.junit-report.outputs.skipped }}|
You can see the Native JUnit report [here](${{ steps.junit-report.outputs.runHtmlUrl }}).
</details>
append: true

- name: Update PR status comment on failure
uses: marocchino/sticky-pull-request-comment@v2
if: ${{ github.event_name == 'pull_request' && steps.junit-report.conclusion != 'success' }}
with:
header: reports
message: |
<details>
<summary><h3>😔 Native JUnit tests failed</h3></summary>
|Passed|Failed|Skipped|
|----------|---------|-----------|
|✅ ${{ steps.junit-report.outputs.passed }}|❌ ${{ steps.junit-report.outputs.failed }}|⚠️ ${{ steps.junit-report.outputs.skipped }}|
You can see the Native JUnit report [here](${{ steps.junit-report.outputs.runHtmlUrl }}).
</details>
append: true

- name: Cancel Build
if: ${{ failure() }}
uses: andymckay/[email protected]

0 comments on commit 33b00ca

Please sign in to comment.