From 2413b8aa9f0b434b3a4033d5d00378327a64a25d Mon Sep 17 00:00:00 2001 From: Richard Li <742829+rli@users.noreply.github.com> Date: Fri, 1 Aug 2025 11:33:58 -0700 Subject: [PATCH] ci: don't fail build if coverage should not be reported/failure if token is not available or the target branch is not master, then coverage upload command will report failure additionally, coverage upload failure should not fail the build --- buildspec/linuxTests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildspec/linuxTests.yml b/buildspec/linuxTests.yml index 900b720e61a..241b5bb193a 100644 --- a/buildspec/linuxTests.yml +++ b/buildspec/linuxTests.yml @@ -48,7 +48,7 @@ phases: - VCS_COMMIT_ID="${CODEBUILD_RESOLVED_SOURCE_VERSION}" - CI_BUILD_URL=$(echo $CODEBUILD_BUILD_URL | sed 's/#/%23/g') # Encode `#` in the URL because otherwise the url is clipped in the Codecov.io site - CI_BUILD_ID="${CODEBUILD_BUILD_ID}" - - test -n "${CODECOV_TOKEN}" && [ "$TARGET_BRANCH" = "master" ] && ./codecov --token=${CODECOV_TOKEN} --branch=${CODEBUILD_RESOLVED_SOURCE_VERSION} --repository=${CODEBUILD_SOURCE_REPO_URL} --file=./coverage/amazonq/lcov.info --file=./coverage/toolkit/lcov.info + - test -n "${CODECOV_TOKEN}" && [ "$TARGET_BRANCH" = "master" ] && ./codecov --token=${CODECOV_TOKEN} --branch=${CODEBUILD_RESOLVED_SOURCE_VERSION} --repository=${CODEBUILD_SOURCE_REPO_URL} --file=./coverage/amazonq/lcov.info --file=./coverage/toolkit/lcov.info || true reports: unit-test: