Add assert message to soft assert aggregate diffs #335
Workflow file for this run
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: test-all | |
on: | |
push: | |
branches-ignore: | |
- 'dependabot/**' #avoid duplicates: only run the PR, not the commit | |
tags-ignore: | |
- 'v*' #avoids rerun existing commit on release | |
pull_request: | |
branches: | |
- 'main' | |
jobs: | |
test-java: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: java | |
#if: ${{ false }} # disable for now | |
steps: | |
- name: Checkout GitHub repo | |
uses: actions/checkout@v4 | |
- name: Select Java Version | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: '8' | |
cache: 'maven' | |
- name: Build and test | |
run: mvn test -Dmaven.test.failure.ignore=true -U --no-transfer-progress | |
- name: Publish test report | |
if: always() | |
uses: mikepenz/[email protected] | |
with: | |
check_name: test-report-java | |
report_paths: '**/target/surefire-reports/TEST-*.xml' | |
fail_on_failure: 'true' | |
- if: always() | |
name: Publish test reports | |
uses: actions/upload-artifact@v4 | |
with: | |
name: test-report-java-files | |
#working-directory does not work here | |
path: | | |
java/target/site | |
java/target/*.html | |
java/target/tmp*/*.html | |
test-net: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: net | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/[email protected] | |
with: | |
dotnet-version: '8.0.x' | |
- name: Run test | |
run: dotnet test --logger "trx;LogFileName=../../reports/visual-assert-report.trx" TestVisualAssert/TestVisualAssert.csproj | |
#Shows message in case of some failure (as test report checks are not always produced) | |
- name: Failure message if needed | |
if: failure() | |
run: echo "::error ::There was a build error or test failure, see the log and diff files in the test report artifacts" | |
#prevents execute on pr or dependabot that fails with "Resource not accessible by integration" due to permissions | |
- name: Publish test report | |
if: ${{ always() && github.actor=='javiertuya' }} | |
uses: dorny/test-reporter@v1 | |
with: | |
name: test-report-net | |
#working-directory does not work here | |
path: net/reports/visual-assert-report.trx | |
reporter: dotnet-trx | |
fail-on-error: 'true' | |
- if: always() | |
name: Publish test reports files | |
uses: actions/upload-artifact@v4 | |
with: | |
name: test-report-net-files | |
#working-directory does not work here | |
path: net/reports | |
publish-java-snapshot: | |
#if: ${{ false }} # disable for now | |
#avoid publishing PRs and dependabot branches | |
if: ${{ github.event_name != 'pull_request' && !startsWith(github.ref, 'refs/heads/dependabot/') && !startsWith(github.ref, 'refs/heads/dashgit/combined/') }} | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
defaults: | |
run: | |
working-directory: java | |
steps: | |
- uses: javiertuya/[email protected] | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
working-directory: java | |
java-version: '8' | |
mvn-deploy-args: '-P publish-github -DskipTests=true -Dmaven.test.failure.ignore=false -U --no-transfer-progress' | |
delete-old-snapshots: true | |
min-snapshots-to-keep: 4 |