Script in single line

Change-Id: I41223f4d777747c55c586bb8d2aecd86db21d85f
ben/dropshots
Jose Alcérreca 6 months ago
parent 9c644ba260
commit 799c3d0d77

@ -251,11 +251,9 @@ jobs:
- api-level: 33 - api-level: 33
profile: pixel_fold profile: pixel_fold
target: google_apis target: google_apis
# Enable when a new version of the runner is released. Currently v2.30.1 # TODO: change from VanillaIceCream to 35 when that image is available
# https://github.com/ReactiveCircus/android-emulator-runner/releases/tag/v2.30.1 - api-level: VanillaIceCream
# Also, change from VanillaIceCream to 35 when that image is available profile: pixel_fold
# - api-level: VanillaIceCream
# profile: pixel_fold
steps: steps:
- name: Delete unnecessary tools 🔧 - name: Delete unnecessary tools 🔧
@ -322,15 +320,8 @@ jobs:
profile: ${{ matrix.profile }} profile: ${{ matrix.profile }}
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none 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 # Run tests, if they fail, record screenshots and exit with a failure
script: > script:
set +e ; 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 ; fi
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 ;
fi
- name: Prevent pushing new screenshots if this is a fork - name: Prevent pushing new screenshots if this is a fork
id: checkfork_screenshots_instrumented id: checkfork_screenshots_instrumented

Loading…
Cancel
Save