The action does some script parsing that is breaking the if clause, lets try single line

Change-Id: Icfd4a6fd945393b434c3eb171ddaee376459b0e9
ben/dropshots
Jose Alcérreca 7 months ago
parent 15eeb189ff
commit 9c644ba260

@ -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

Loading…
Cancel
Save