From 1453dc4c34a5d700f95847ea7a16520f2291cbd4 Mon Sep 17 00:00:00 2001 From: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com> Date: Tue, 21 May 2024 14:09:09 -0700 Subject: [PATCH] fix(ci): codecov (#18335) * fix(ci): codecov Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com> * build UI for frontend or backend Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com> * use token, fail ci on error Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com> --------- Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com> --- .github/workflows/ci-build.yaml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-build.yaml b/.github/workflows/ci-build.yaml index 8e49167801ff..0a147b94dc81 100644 --- a/.github/workflows/ci-build.yaml +++ b/.github/workflows/ci-build.yaml @@ -298,7 +298,8 @@ jobs: build-ui: name: Build, test & lint UI code - if: ${{ needs.changes.outputs.frontend == 'true' }} + # We run UI logic for backend changes so that we have a complete set of coverage documents to send to codecov. + if: ${{ needs.changes.outputs.backend == 'true' || needs.changes.outputs.frontend == 'true' }} runs-on: ubuntu-22.04 needs: - changes @@ -368,9 +369,12 @@ jobs: name: test-results path: test-results - name: Upload code coverage information to codecov.io - uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # v3.1.4 + uses: codecov/codecov-action@125fc84a9a348dbcf27191600683ec096ec9021c # v4.4.1 with: file: coverage.out + fail_ci_if_error: true + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - name: Perform static code analysis using SonarCloud env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}