Skip to content

Commit

Permalink
Publish test results using EnricoMi/publish-unit-test-result-action
Browse files Browse the repository at this point in the history
  • Loading branch information
gesellix committed Aug 25, 2023
1 parent 4c444a7 commit 1f210e2
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 16 deletions.
38 changes: 30 additions & 8 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,27 @@ on:
branches:
- main
jobs:
publish:
event-file:
# https://github.com/marketplace/actions/publish-test-results#support-fork-repositories-and-dependabot-branches
name: "Event File"
runs-on: ubuntu-latest
steps:
- name: Upload
uses: actions/upload-artifact@v3
with:
name: event-file
path: ${{ github.event_path }}
publish:
strategy:
matrix:
os:
- ubuntu-latest
# - windows-latest
# - macos-latest
java:
- 8
# - 17
runs-on: ${{ matrix.os }}
timeout-minutes: 20
steps:
- uses: actions/checkout@v3
Expand All @@ -16,18 +35,21 @@ jobs:
uses: actions/[email protected]
with:
distribution: 'zulu'
java-version: 8
cache: 'gradle'
java-version: ${{ matrix.java }}
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: build publish
run: ./gradlew clean build publish --info --stacktrace
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.GPG_SIGNING_KEY }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.GPG_SIGNING_PASSWORD }}
- name: Publish Test Report
if: ${{ always() }}
uses: scacap/action-surefire-report@v1
- name: Upload Test Results
# see publish-test-results.yml for workflow that publishes test results without security issues for forks
# https://github.com/marketplace/actions/publish-test-results#support-fork-repositories-and-dependabot-branches
if: always()
uses: actions/upload-artifact@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
report_paths: '**/build/test-results/test/TEST-*.xml'
name: Test Results (Java ${{ matrix.java }} on ${{ matrix.os }})
path: '**/build/test-results/test/TEST-*.xml'
...
1 change: 1 addition & 0 deletions .github/workflows/publish-test-results.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ on:
workflows:
- CI
- Publish
- Release
types:
- completed
permissions: {}
Expand Down
38 changes: 30 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,27 @@ on:
# - published

jobs:
release:
event-file:
# https://github.com/marketplace/actions/publish-test-results#support-fork-repositories-and-dependabot-branches
name: "Event File"
runs-on: ubuntu-latest
steps:
- name: Upload
uses: actions/upload-artifact@v3
with:
name: event-file
path: ${{ github.event_path }}
release:
strategy:
matrix:
os:
- ubuntu-latest
# - windows-latest
# - macos-latest
java:
- 8
# - 17
runs-on: ${{ matrix.os }}
timeout-minutes: 20
steps:
- uses: actions/checkout@v3
Expand All @@ -18,8 +37,9 @@ jobs:
uses: actions/[email protected]
with:
distribution: 'zulu'
java-version: 8
cache: 'gradle'
java-version: ${{ matrix.java }}
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Set artifact version
run: |
echo "RELEASE_VERSION=$(echo '${{ github.event.release.tag_name }}' | sed -e s/^v//)" >> $GITHUB_ENV
Expand All @@ -32,10 +52,12 @@ jobs:
SONATYPE_STAGING_PROFILE_ID: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
- name: Publish Test Report
if: ${{ always() }}
uses: scacap/action-surefire-report@v1
- name: Upload Test Results
# see publish-test-results.yml for workflow that publishes test results without security issues for forks
# https://github.com/marketplace/actions/publish-test-results#support-fork-repositories-and-dependabot-branches
if: always()
uses: actions/upload-artifact@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
report_paths: '**/build/test-results/test/TEST-*.xml'
name: Test Results (Java ${{ matrix.java }} on ${{ matrix.os }})
path: '**/build/test-results/test/TEST-*.xml'
...

0 comments on commit 1f210e2

Please sign in to comment.