From d55f2874975222f5c51dd5702b760d5eda84febd Mon Sep 17 00:00:00 2001 From: Juergen Repp Date: Mon, 3 Feb 2025 14:14:19 +0100 Subject: [PATCH] ci: Fix github action for codecov. The usage of https://codecov.io/bash is deprecated and replaced with https://uploader.codecov.io/latest/linux/codecov Signed-off-by: Juergen Repp --- .ci/docker.env | 1 + .ci/docker.run | 7 ++++++- .github/workflows/main.yml | 10 ++++++++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/.ci/docker.env b/.ci/docker.env index ef4fb2d58..6f2a304a2 100644 --- a/.ci/docker.env +++ b/.ci/docker.env @@ -24,3 +24,4 @@ WITH_TCTI GEN_FUZZ TEST_TCTI_CONFIG ENABLE_COVERAGE +CODECOV_TOKEN diff --git a/.ci/docker.run b/.ci/docker.run index c45c8ad52..5defc1293 100755 --- a/.ci/docker.run +++ b/.ci/docker.run @@ -151,6 +151,11 @@ if [ -n "$BASE_REF" ]; then fi if [ "$ENABLE_COVERAGE" == "true" ]; then - bash <(curl -s https://codecov.io/bash) + + lcov --capture --directory . --output-file ./coverage.info + curl -Os https://uploader.codecov.io/latest/linux/codecov + chmod +x codecov + ./codecov -f ./coverage.info -t ${CODECOV_TOKEN} fi + exit 0 diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 76e4a645a..d72ce16a1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -128,10 +128,20 @@ jobs: uses: tpm2-software/ci/runCI@main with: + token: ${{ secrets.CODECOV_TOKEN }} CC: gcc DOCKER_IMAGE: ubuntu-20.04 ENABLE_COVERAGE: true PROJECT_NAME: ${{ github.event.repository.name }} + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + - name: Upload Coverage to Codecov + uses: codecov/codecov-action@v4 + with: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + token: ${{ secrets.CODECOV_TOKEN }} + files: ./coverage.info + fail_ci_if_error: true + verbose: true - name: failure if: ${{ failure() }} run: cat $(find ../ -name test-suite.log) || true