Add documentation for test report access in GitHub Actions #3
This file contains hidden or 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: Publish to GitHub Packages | |
| on: | |
| push: | |
| branches: [main] | |
| release: | |
| types: [published] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| packages: write | |
| checks: write | |
| pull-requests: write | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '21' | |
| distribution: 'temurin' | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v4 | |
| - name: Build project | |
| run: ./gradlew build | |
| env: | |
| USERNAME: ${{ github.actor }} | |
| TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Upload test reports | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: test-reports | |
| path: | | |
| build/reports/tests/ | |
| build/test-results/ | |
| retention-days: 30 | |
| - name: Publish test results | |
| uses: dorny/test-reporter@v1 | |
| if: always() | |
| with: | |
| name: Test Results | |
| path: 'build/test-results/**/TEST-*.xml' | |
| reporter: java-junit | |
| fail-on-error: false | |
| - name: Publish to GitHub Packages | |
| run: ./gradlew publishAllPublicationsToGitHubPackagesRepository | |
| env: | |
| USERNAME: ${{ github.actor }} | |
| TOKEN: ${{ secrets.GITHUB_TOKEN }} |