From 4cf754cb3498d2bc9a1651814232fadefb3b1796 Mon Sep 17 00:00:00 2001 From: Alain Nicolas Date: Tue, 22 Oct 2024 12:12:46 +0200 Subject: [PATCH] chore(ci): Upload SDK coverage report only from the main repository --- .github/workflows/sdk.yml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/.github/workflows/sdk.yml b/.github/workflows/sdk.yml index 44a1f040..2b3b7eb7 100644 --- a/.github/workflows/sdk.yml +++ b/.github/workflows/sdk.yml @@ -59,6 +59,9 @@ jobs: run: mv coverage/lcov.info . - name: Upload coverage report to Codecov + if: env.CODECOV_TOKEN != '' + env: + CODECOV_TOKEN: ${{secrets.CODECOV_TOKEN}} uses: codecov/codecov-action@v3 with: files: ./sdk/lcov.info @@ -72,11 +75,22 @@ jobs: coverage-file: sdk/lcov.info minimum-coverage: 50 - - name: Add coverage summary + - name: Add coverage summary if upload + if: env.CODECOV_TOKEN != '' + env: + CODECOV_TOKEN: ${{secrets.CODECOV_TOKEN}} run: | echo "## Coverage result" >> $GITHUB_STEP_SUMMARY echo "✅ Uploaded to Codecov" >> $GITHUB_STEP_SUMMARY + - name: Add coverage summary if no upload + if: env.CODECOV_TOKEN == '' + env: + CODECOV_TOKEN: ${{secrets.CODECOV_TOKEN}} + run: | + echo "## Coverage result" >> $GITHUB_STEP_SUMMARY + echo "✅ Coverage not uploaded to Codecov" >> $GITHUB_STEP_SUMMARY + integration-test-sdk: runs-on: ubuntu-latest