From 6ebcb8694ae12fe190fc616eba5f80b173307ab1 Mon Sep 17 00:00:00 2001 From: Eduardo Apolinario <653394+eapolinario@users.noreply.github.com> Date: Mon, 29 Apr 2024 14:34:31 -0700 Subject: [PATCH] Fix uploading of code coverage data (#5298) * Do not upload codecoverage data from boilerplate Signed-off-by: Eduardo Apolinario * Use correct token to upload code coverage data Signed-off-by: Eduardo Apolinario * Pipe in CODECOV_TOKEN as an input secret Signed-off-by: Eduardo Apolinario * Actually pipe the secret in Signed-off-by: Eduardo Apolinario * Pipe codecov token in flyteidl tests too --------- Signed-off-by: Eduardo Apolinario Co-authored-by: Eduardo Apolinario --- .github/workflows/checks.yml | 2 +- .github/workflows/flyteidl-checks.yml | 2 +- .github/workflows/unit-tests.yml | 12 ++++-------- boilerplate/flyte/golang_test_targets/Makefile | 1 - 4 files changed, 6 insertions(+), 11 deletions(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 8532179444..95f5a04893 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -61,7 +61,7 @@ jobs: component: ${{ matrix.component }} go-version: ${{ needs.unpack-envvars.outputs.go-version }} secrets: - FLYTE_BOT_PAT: ${{ secrets.FLYTE_BOT_PAT }} + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} docker-build: strategy: fail-fast: false diff --git a/.github/workflows/flyteidl-checks.yml b/.github/workflows/flyteidl-checks.yml index 1811126d91..89f1fc5c81 100644 --- a/.github/workflows/flyteidl-checks.yml +++ b/.github/workflows/flyteidl-checks.yml @@ -39,7 +39,7 @@ jobs: component: flyteidl go-version: ${{ needs.unpack-envvars.outputs.go-version }} secrets: - FLYTE_BOT_PAT: ${{ secrets.FLYTE_BOT_PAT }} + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} generate: name: Check Go Generate needs: diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 475e010496..aa5466304f 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -10,7 +10,7 @@ on: required: true type: string secrets: - FLYTE_BOT_PAT: + CODECOV_TOKEN: required: true jobs: tests: @@ -27,15 +27,11 @@ jobs: with: go-version: ${{ inputs.go-version }} - name: Unit Tests - env: - GITHUB_TOKEN: ${{ secrets.FLYTE_BOT_PAT }} run: make install && make test_unit_codecov - # TODO(monorepo): Figure out how to do code coverage aggregation - name: Push CodeCov - uses: codecov/codecov-action@v3.1.1 - env: - GITHUB_TOKEN: ${{ secrets.FLYTE_BOT_PAT }} + uses: codecov/codecov-action@v4 with: file: coverage.txt - flags: unittests + flags: unittests-${{ inputs.component }} fail_ci_if_error: false + token: ${{ secrets.CODECOV_TOKEN }} diff --git a/boilerplate/flyte/golang_test_targets/Makefile b/boilerplate/flyte/golang_test_targets/Makefile index 3f743e8625..4b0f254329 100644 --- a/boilerplate/flyte/golang_test_targets/Makefile +++ b/boilerplate/flyte/golang_test_targets/Makefile @@ -54,7 +54,6 @@ test_unit_visual: .PHONY: test_unit_codecov test_unit_codecov: go test ./... -race -coverprofile=coverage.txt -covermode=atomic - curl -s https://codecov.io/bash > codecov_bash.sh && bash codecov_bash.sh .PHONY: go-tidy go-tidy: