#316 Use Test Result publisher GH action #45
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: Gradle Build Check | |
on: | |
pull_request: | |
push: | |
workflow_dispatch: {} | |
jobs: | |
gradle: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-java@v3 | |
with: | |
distribution: temurin | |
java-version: 8 | |
- name: Setup Gradle | |
uses: gradle/gradle-build-action@v2 | |
- name: Execute Gradle build | |
run: ./gradlew check --scan -stacktrace | |
- name: 'Upload Test Results' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: 'Test Results' | |
path: build/reports/tests | |
- name: 'Generate Test Results Preview' | |
uses: pavi2410/html-preview-action@v2 | |
id: preview_test_reports | |
with: | |
html_file: 'build/reports/tests/test/index.html' | |
- name: 'Show Test Result Preview' | |
run: | |
echo "::notice ${{ format('[Click here to preview Test Results HTML page in browser]({0})', steps.preview_test_reports.outputs.url) }}" | |
- name: Publish Test Results | |
uses: EnricoMi/publish-unit-test-result-action/composite@v2 | |
if: always() | |
with: | |
files: | | |
build/test-results/**/*.xml |