From 22f201dc3d633d985771d0cc466213a26f883448 Mon Sep 17 00:00:00 2001 From: Rd Date: Sun, 21 Jul 2024 16:32:49 +0530 Subject: [PATCH] Re running, also un commenting the oppia build tests caching - probably its not gonna do anything as its only with caching --- .github/workflows/code_coverage.yml | 48 ++++++++++++++--------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/.github/workflows/code_coverage.yml b/.github/workflows/code_coverage.yml index a0621468efe..8faa6fe1df2 100644 --- a/.github/workflows/code_coverage.yml +++ b/.github/workflows/code_coverage.yml @@ -242,30 +242,30 @@ jobs: cd $GITHUB_WORKSPACE git secret reveal -# # See https://www.cyberciti.biz/faq/unix-for-loop-1-to-10/ for for-loop reference. -# - name: Build Oppia Tests (with caching, non-fork only) -# if: ${{ env.ENABLE_CACHING == 'true' && ((github.ref == 'refs/heads/develop' && github.event_name == 'push') || (github.event.pull_request.head.repo.full_name == 'oppia/oppia-android')) }} -# env: -# BAZEL_REMOTE_CACHE_URL: ${{ secrets.BAZEL_REMOTE_CACHE_URL }} -# BAZEL_TEST_TARGETS: ${{ env.BAZEL_TEST_TARGETS }} -# run: | -# # Attempt to build 5 times in case there are flaky builds. -# # TODO(#3759): Remove this once there are no longer app test build failures. -# i=0 -# # Disable exit-on-first-failure. -# set +e -# while [ $i -ne 5 ]; do -# i=$(( $i+1 )) -# echo "Attempt $i/5 to build test targets" -# bazel build --keep_going --remote_http_cache=$BAZEL_REMOTE_CACHE_URL --google_credentials=./config/oppia-dev-workflow-remote-cache-credentials.json -- $BAZEL_TEST_TARGETS -# done -# # Capture the error code of the final command run (which should be a success if there isn't a real build failure). -# last_error_code=$? -# # Reenable exit-on-first-failure. -# set -e -# # Exit only if the most recent exit was a failure (by using a subshell). -# (exit $last_error_code) -# + # See https://www.cyberciti.biz/faq/unix-for-loop-1-to-10/ for for-loop reference. + - name: Build Oppia Tests (with caching, non-fork only) + if: ${{ env.ENABLE_CACHING == 'true' && ((github.ref == 'refs/heads/develop' && github.event_name == 'push') || (github.event.pull_request.head.repo.full_name == 'oppia/oppia-android')) }} + env: + BAZEL_REMOTE_CACHE_URL: ${{ secrets.BAZEL_REMOTE_CACHE_URL }} + BAZEL_TEST_TARGETS: ${{ env.BAZEL_TEST_TARGETS }} + run: | + # Attempt to build 5 times in case there are flaky builds. + # TODO(#3759): Remove this once there are no longer app test build failures. + i=0 + # Disable exit-on-first-failure. + set +e + while [ $i -ne 5 ]; do + i=$(( $i+1 )) + echo "Attempt $i/5 to build test targets" + bazel build --keep_going --remote_http_cache=$BAZEL_REMOTE_CACHE_URL --google_credentials=./config/oppia-dev-workflow-remote-cache-credentials.json -- $BAZEL_TEST_TARGETS + done + # Capture the error code of the final command run (which should be a success if there isn't a real build failure). + last_error_code=$? + # Reenable exit-on-first-failure. + set -e + # Exit only if the most recent exit was a failure (by using a subshell). + (exit $last_error_code) + # - name: Build Oppia Tests (without caching, or on a fork) # if: ${{ env.ENABLE_CACHING == 'false' || ((github.ref != 'refs/heads/develop' || github.event_name != 'push') && (github.event.pull_request.head.repo.full_name != 'oppia/oppia-android')) }} # env: