Skip to content

Commit b969885

Browse files
0xadam-browncursoragent
authored andcommitted
fix(ci): Harden snapshot upload after Gradle cache hits
Use :test with --no-configuration-cache when snapshots are missing, and skip the sentry-cli upload with a warning instead of failing the job. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 44934c7 commit b969885

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

.github/workflows/build.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,15 @@ jobs:
5555
SNAPSHOT_DIR=./sentry-android-core/build/test-snapshots
5656
if [ ! -d "$SNAPSHOT_DIR" ]; then
5757
echo "Snapshot directory missing (likely Gradle cache hit); running screenshot tests"
58-
./gradlew :sentry-android-core:testDebugUnitTest --tests io.sentry.android.core.ScreenshotEventProcessorTest
58+
./gradlew :sentry-android-core:test \
59+
--tests io.sentry.android.core.ScreenshotEventProcessorTest \
60+
--rerun-tasks --no-configuration-cache
61+
fi
62+
if [ -d "$SNAPSHOT_DIR" ]; then
63+
sentry-cli build snapshots "$SNAPSHOT_DIR" --app-id sentry-android-core
64+
else
65+
echo "::warning::Snapshot directory still missing after rerun; skipping upload"
5966
fi
60-
sentry-cli build snapshots "$SNAPSHOT_DIR" \
61-
--app-id sentry-android-core
6267
env:
6368
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
6469
SENTRY_ORG: sentry-sdks

0 commit comments

Comments
 (0)