diff --git a/.github/workflows/Build.yaml b/.github/workflows/Build.yaml index 635a00362..a3737a17d 100644 --- a/.github/workflows/Build.yaml +++ b/.github/workflows/Build.yaml @@ -322,15 +322,14 @@ jobs: profile: ${{ matrix.profile }} emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none # Run tests, if they fail, record screenshots and exit with a failure - script: | - set +e - if ./gradlew connectedDemoDebugAndroidTest -Pandroid.testInstrumentationRunnerArguments.annotation=com.google.samples.apps.nowinandroid.ui.InstrumentedScreenshotTests --daemon - then - echo "All screenshot tests passed" + script: > + set +e ; + if ./gradlew connectedDemoDebugAndroidTest -Pandroid.testInstrumentationRunnerArguments.annotation=com.google.samples.apps.nowinandroid.ui.InstrumentedScreenshotTests --daemon ; then + echo "All screenshot tests passed" ; else - echo "Recording new goldens" - ./gradlew connectedDemoDebugAndroidTest -Pandroid.testInstrumentationRunnerArguments.annotation=com.google.samples.apps.nowinandroid.ui.InstrumentedScreenshotTests -Pdropshots.record --daemon --stacktrace - echo "newgoldens=true" >> $GITHUB_OUTPUT + echo "Recording new goldens" ; + ./gradlew connectedDemoDebugAndroidTest -Pandroid.testInstrumentationRunnerArguments.annotation=com.google.samples.apps.nowinandroid.ui.InstrumentedScreenshotTests -Pdropshots.record --daemon --stacktrace ; + echo "newgoldens=true" >> $GITHUB_OUTPUT ; fi - name: Prevent pushing new screenshots if this is a fork