Skip to content

Commit e2a935b

Browse files
authored
devops: fix nits in browser compilation infrastructure (#5526)
This patch: - makes sure that failed runs actually show as failed in GHA - attempts to use MINGW's `du` and `awk` to get upload size
1 parent c57f1fc commit e2a935b

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

browser_patches/checkout_build_archive_upload.sh

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -311,12 +311,12 @@ send_telegram_message "$BUILD_ALIAS -- started"
311311

312312
if generate_and_upload_browser_build 2>&1 | ./sanitize_and_compress_log.js $LOG_PATH; then
313313
# Report successful build. Note: we don't know how to get zip size on MINGW.
314-
if [[ $(uname) == MINGW* ]]; then
315-
send_telegram_message "$BUILD_ALIAS -- uploaded"
316-
else
317-
UPLOAD_SIZE=$(du -h "$ZIP_PATH" | awk '{print $1}')
318-
send_telegram_message "$BUILD_ALIAS -- $UPLOAD_SIZE uploaded"
314+
UPLOAD_SIZE=""
315+
if command -v du >/dev/null && command -v awk >/dev/null; then
316+
UPLOAD_SIZE="$(du -h "$ZIP_PATH" | awk '{print $1}') "
319317
fi
318+
send_telegram_message "$BUILD_ALIAS -- ${UPLOAD_SIZE}uploaded"
319+
320320
# Check if we uploaded the last build.
321321
if ./tools/check_cdn.sh $BROWSER_NAME --has-all-builds; then
322322
LAST_COMMIT_MESSAGE=$(git log --format=%s -n 1 HEAD -- ./$BROWSER_NAME/BUILD_NUMBER)
@@ -344,5 +344,6 @@ else
344344
# Upload logs only in case of failure and report failure.
345345
./upload.sh ${LOG_BLOB_PATH} ${LOG_PATH} || true
346346
send_telegram_message "$BUILD_ALIAS -- ${FAILED_STEP} failed! ❌ <a href='https://playwright.azureedge.net/builds/${LOG_BLOB_PATH}'>${LOG_BLOB_NAME}</a>"
347+
exit 1
347348
fi
348349

0 commit comments

Comments
 (0)