Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publish test results using EnricoMi/publish-unit-test-result-action #101

Merged
merged 1 commit into from
Aug 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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'
...