if ./gradlew connectedDemoDebugAndroidTest -Pandroid.testInstrumentationRunnerArguments.annotation=com.google.samples.apps.nowinandroid.ui.InstrumentedScreenshotTests --daemon ; then
echo "All screenshot tests passed"
else
echo "Verification failed. Recording new reference images"
if ./gradlew connectedDemoDebugAndroidTest -Pandroid.testInstrumentationRunnerArguments.annotation=com.google.samples.apps.nowinandroid.ui.InstrumentedScreenshotTests -Pdropshots.record --daemon --stacktrace ; then
echo "New goldens recorded, no issues"
; echo "newgoldens=true" >> $GITHUB_OUTPUT
else
echo "Error while recording new goldens"
; exit 5
fi
fi
- name:Prevent pushing new screenshots if this is a fork