Skip to content

Commit

Permalink
Fix uploading of code coverage data (#5298)
Browse files Browse the repository at this point in the history
* Do not upload codecoverage data from boilerplate

Signed-off-by: Eduardo Apolinario <[email protected]>

* Use correct token to upload code coverage data

Signed-off-by: Eduardo Apolinario <[email protected]>

* Pipe in CODECOV_TOKEN as an input secret

Signed-off-by: Eduardo Apolinario <[email protected]>

* Actually pipe the secret in

Signed-off-by: Eduardo Apolinario <[email protected]>

* Pipe codecov token in flyteidl tests too

---------

Signed-off-by: Eduardo Apolinario <[email protected]>
Co-authored-by: Eduardo Apolinario <[email protected]>
  • Loading branch information
eapolinario and eapolinario authored Apr 29, 2024
1 parent f32132b commit 6ebcb86
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/flyteidl-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
12 changes: 4 additions & 8 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
required: true
type: string
secrets:
FLYTE_BOT_PAT:
CODECOV_TOKEN:
required: true
jobs:
tests:
Expand All @@ -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/[email protected]
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 }}
1 change: 0 additions & 1 deletion boilerplate/flyte/golang_test_targets/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 6ebcb86

Please sign in to comment.