Skip to content

Commit

Permalink
Consolidated test reports published to pages
Browse files Browse the repository at this point in the history
  • Loading branch information
javiertuya committed Jul 15, 2024
1 parent 8f5af43 commit d26c25f
Showing 1 changed file with 79 additions and 0 deletions.
79 changes: 79 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,3 +112,82 @@ jobs:
**/target/pit-reports
**/target/*.html
**/target/*.log
test-report:
needs: [test]
#if: ${{ false }} # disable for now
#avoid publishing to Github pages PRs and dependabot branches
if: ${{ always() && github.event_name != 'pull_request' && !contains('/head/refs/dependabot/', github.ref) && !contains('/head/refs/dashgit/combined/', github.ref) }}
runs-on: ubuntu-latest
# Configuration to deploy at github pages
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: true
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
# Downloads all artifacts with test report files
- uses: actions/[email protected]
if: always()
with:
path: .
- run: ls -la

# Generates and uploads the html reports and the individual surefire reports for further reference
# Includes the options to add links to Visual Assert diff files
- name: Aggregated junit html report
if: always()
uses: javiertuya/[email protected]
with:
surefire-files: "**/target/surefire-reports/TEST-*.xml"
report-dir: reports
report-title: "Test Report: ALL - Branch: ${{ github.ref_name }} - Run #${{ github.run_number }}"
diff-links-enabled: true
#diff-links-prefix: "target/"
diff-links-reports: "reports/junit-*/**/*.html"
#diff-links-files: "/**/target/*.html"

- name: Copy pit reports
run: cp -r test-report-files-Eval/st-tdg-eval/target/pit-reports reports/pit-reports
- name: Index file to html reports
if: always()
run: |
echo "<html><head><title>Latest Test Reports</title></head><body>" > index.html
echo "<h2>Latest Test Reports - Branch: ${{ github.ref_name }} - Run #${{ github.run_number }}</h2>" >> index.html
echo "<p><a href=\"reports/junit-noframes/junit-noframes.html\">JUnit test report - Single page</a></p>" >> index.html
echo "<p><a href=\"reports/junit-frames/index.html\">JUnit test report - Multiple page with frames</a></p>" >> index.html
echo "<p><a href=\"reports/pit-reports/index.html\">PIT test report</a></p>" >> index.html
echo "</body></html>" >> index.html
ls -la reports
- name: Publish test report files
if: always()
uses: actions/upload-artifact@v4
with:
name: "test-report-ALL"
path: |
reports
**/target/surefire-reports
**/target/*.html
**/target/*.log
# Deploy to GitHub Pages
# Some files (e.g. junit reports) have 600 permissions.
# As of [email protected], permissions must be set explicitly
# to 0755 (as indicated in warnings produced by v1.0.8)
- name: Fix permissions to actions/[email protected]
if: always()
run: sudo chmod -c -R 0755 reports
- name: Upload artifact
if: always()
uses: actions/[email protected]
with:
path: "."
- name: Deploy to GitHub Pages
if: always()
id: deployment
uses: actions/[email protected]

0 comments on commit d26c25f

Please sign in to comment.