This is an automated email from the ASF dual-hosted git repository.

lhotari pushed a commit to branch branch-3.0
in repository https://gitbox.apache.org/repos/asf/pulsar.git

commit fe0b666efd9ad169d2359b933d5ebf9ee068ec72
Author: Lari Hotari <[email protected]>
AuthorDate: Thu Jul 31 18:13:41 2025 +0300

    [fix][ci] Fix code coverage metrics in Pulsar CI (#24595)
    
    (cherry picked from commit 9543bda10c69966957d10afd1d72ceac53f0c88f)
---
 .github/actions/upload-coverage/action.yml | 13 ++++++++++---
 .github/workflows/pulsar-ci-flaky.yaml     |  1 +
 .github/workflows/pulsar-ci.yaml           |  3 +++
 3 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/.github/actions/upload-coverage/action.yml 
b/.github/actions/upload-coverage/action.yml
index 0ba73e94a83..9cdf1e2326e 100644
--- a/.github/actions/upload-coverage/action.yml
+++ b/.github/actions/upload-coverage/action.yml
@@ -28,6 +28,10 @@ inputs:
   flags:
     # see https://github.com/codecov/codecov-action#arguments
     description: 'Flag the upload to group coverage metrics. Multiple flags 
are separated by a comma.'
+  token:
+    description: 'Codecov token to use for uploading coverage metrics.'
+    required: false
+    default: ''
 runs:
   using: composite
   steps:
@@ -51,11 +55,12 @@ runs:
     - name: "Upload to Codecov (attempt #1)"
       id: codecov-upload-1
       if: steps.repo-check.outputs.passed == 'true'
-      uses: codecov/codecov-action@v4
+      uses: codecov/codecov-action@v5
       continue-on-error: true
       with:
         flags: ${{ inputs.flags }}
         fail_ci_if_error: true
+        token: ${{ inputs.token }}
         verbose: true
     - name: "Wait 15 seconds before next attempt"
       if: steps.codecov-upload-1.outcome == 'failure'
@@ -64,11 +69,12 @@ runs:
     - name: "Upload to Codecov (attempt #2)"
       id: codecov-upload-2
       if: steps.codecov-upload-1.outcome == 'failure'
-      uses: codecov/codecov-action@v4
+      uses: codecov/codecov-action@v5
       continue-on-error: true
       with:
         flags: ${{ inputs.flags }}
         fail_ci_if_error: true
+        token: ${{ inputs.token }}
         verbose: true
     - name: "Wait 60 seconds before next attempt"
       if: steps.codecov-upload-2.outcome == 'failure'
@@ -77,12 +83,13 @@ runs:
     - name: "Upload to Codecov (attempt #3)"
       id: codecov-upload-3
       if: steps.codecov-upload-2.outcome == 'failure'
-      uses: codecov/codecov-action@v4
+      uses: codecov/codecov-action@v5
       # fail on last attempt
       continue-on-error: false
       with:
         flags: ${{ inputs.flags }}
         fail_ci_if_error: true
+        token: ${{ inputs.token }}
         verbose: true
     - name: "Show link to Codecov report"
       shell: bash
diff --git a/.github/workflows/pulsar-ci-flaky.yaml 
b/.github/workflows/pulsar-ci-flaky.yaml
index 548e845bb88..6b6c43e0e1d 100644
--- a/.github/workflows/pulsar-ci-flaky.yaml
+++ b/.github/workflows/pulsar-ci-flaky.yaml
@@ -167,6 +167,7 @@ jobs:
         uses: ./.github/actions/upload-coverage
         with:
           flags: unittests
+          token: ${{ secrets.CODECOV_TOKEN }}
 
       - name: Publish Test Report
         uses: apache/pulsar-test-infra/action-junit-report@master
diff --git a/.github/workflows/pulsar-ci.yaml b/.github/workflows/pulsar-ci.yaml
index 79963d653ab..e0276c803e4 100644
--- a/.github/workflows/pulsar-ci.yaml
+++ b/.github/workflows/pulsar-ci.yaml
@@ -371,6 +371,7 @@ jobs:
         uses: ./.github/actions/upload-coverage
         with:
           flags: unittests
+          token: ${{ secrets.CODECOV_TOKEN }}
 
       - name: Delete coverage files from build artifacts
         run: |
@@ -690,6 +691,7 @@ jobs:
         uses: ./.github/actions/upload-coverage
         with:
           flags: inttests
+          token: ${{ secrets.CODECOV_TOKEN }}
 
       - name: Delete coverage files from build artifacts
         run: |
@@ -1053,6 +1055,7 @@ jobs:
         uses: ./.github/actions/upload-coverage
         with:
           flags: systests
+          token: ${{ secrets.CODECOV_TOKEN }}
 
       - name: Delete coverage files from build artifacts
         run: |

Reply via email to