From 65a1b8f211ecbf6266c6e4a03669e8245aef7774 Mon Sep 17 00:00:00 2001 From: QuantumNeuralCoder <163458725+QuantumNeuralCoder@users.noreply.github.com> Date: Tue, 13 May 2025 14:04:52 -0700 Subject: [PATCH 1/4] chore: split codecov to collect and upload --- .github/workflows/codecov-collect.yml | 41 +++++++++++++++++++++++++++ .github/workflows/codecov-upload.yml | 34 ++++++++++++++++++++++ 2 files changed, 75 insertions(+) create mode 100644 .github/workflows/codecov-collect.yml create mode 100644 .github/workflows/codecov-upload.yml diff --git a/.github/workflows/codecov-collect.yml b/.github/workflows/codecov-collect.yml new file mode 100644 index 0000000000000..6ee075acc36d1 --- /dev/null +++ b/.github/workflows/codecov-collect.yml @@ -0,0 +1,41 @@ +name: Codecov Collect + +on: + pull_request: + +permissions: + contents: read + +jobs: + collect: + name: Collect Coverage + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Node + uses: actions/setup-node@v4 + + - name: Install dependencies + run: yarn install + + - name: Build Library + run: npx lerna run build --scope=aws-cdk-lib + + - name: Run Core tests + run: cd packages/aws-cdk-lib && yarn test core + + - name: Save PR number + run: | + mkdir -p ./pr + echo ${{ github.event.number }} > ./pr/NR + + - name: Upload Coverage and PR Info + uses: actions/upload-artifact@v4 + with: + name: coverage-artifacts + path: | + packages/aws-cdk-lib/coverage/cobertura-coverage.xml + pr/NR diff --git a/.github/workflows/codecov-upload.yml b/.github/workflows/codecov-upload.yml new file mode 100644 index 0000000000000..b31fb1269ad61 --- /dev/null +++ b/.github/workflows/codecov-upload.yml @@ -0,0 +1,34 @@ +name: Codecov Upload + +on: + workflow_run: + workflows: ["Codecov Collect"] + types: + - completed + +permissions: + contents: write + id-token: write + +jobs: + upload: + name: Upload to Codecov + runs-on: ubuntu-latest + if: > + github.event.workflow_run.event == 'pull_request' && + github.event.workflow_run.conclusion == 'success' + + steps: + - name: Download Artifacts + uses: actions/download-artifact@v4 + with: + name: coverage-artifacts + path: ./coverage + + - name: Upload to Codecov + uses: codecov/codecov-action@v5 + with: + files: ./coverage/packages/aws-cdk-lib/coverage/cobertura-coverage.xml + fail_ci_if_error: true + flags: suite.unit + use_oidc: true From 83b695552f7c52ec11e5db48df5d884cea67a6b7 Mon Sep 17 00:00:00 2001 From: QuantumNeuralCoder <163458725+QuantumNeuralCoder@users.noreply.github.com> Date: Tue, 13 May 2025 14:44:25 -0700 Subject: [PATCH 2/4] removing the step save pr number --- .github/workflows/codecov-collect.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/codecov-collect.yml b/.github/workflows/codecov-collect.yml index 6ee075acc36d1..38def10b3ffd8 100644 --- a/.github/workflows/codecov-collect.yml +++ b/.github/workflows/codecov-collect.yml @@ -27,15 +27,9 @@ jobs: - name: Run Core tests run: cd packages/aws-cdk-lib && yarn test core - - name: Save PR number - run: | - mkdir -p ./pr - echo ${{ github.event.number }} > ./pr/NR - - name: Upload Coverage and PR Info uses: actions/upload-artifact@v4 with: name: coverage-artifacts path: | packages/aws-cdk-lib/coverage/cobertura-coverage.xml - pr/NR From a75c9e23e12a25f304442dad29a701e34d12517e Mon Sep 17 00:00:00 2001 From: QuantumNeuralCoder <163458725+QuantumNeuralCoder@users.noreply.github.com> Date: Tue, 13 May 2025 17:07:50 -0700 Subject: [PATCH 3/4] fixing an issue with upload --- .github/workflows/codecov-upload.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/codecov-upload.yml b/.github/workflows/codecov-upload.yml index b31fb1269ad61..1a66075bde6fc 100644 --- a/.github/workflows/codecov-upload.yml +++ b/.github/workflows/codecov-upload.yml @@ -24,6 +24,8 @@ jobs: with: name: coverage-artifacts path: ./coverage + repository: ${{ github.repository }} + run-id: ${{ github.event.workflow_run.id }} - name: Upload to Codecov uses: codecov/codecov-action@v5 From d31c08e1dac5a20ecbd2c3c7f149f6901bc01745 Mon Sep 17 00:00:00 2001 From: QuantumNeuralCoder <163458725+QuantumNeuralCoder@users.noreply.github.com> Date: Wed, 14 May 2025 09:56:31 -0700 Subject: [PATCH 4/4] fixing an issue with upload --- .github/workflows/codecov-upload.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/codecov-upload.yml b/.github/workflows/codecov-upload.yml index 1a66075bde6fc..cc663acd08265 100644 --- a/.github/workflows/codecov-upload.yml +++ b/.github/workflows/codecov-upload.yml @@ -9,6 +9,7 @@ on: permissions: contents: write id-token: write + actions: read jobs: upload: @@ -19,6 +20,10 @@ jobs: github.event.workflow_run.conclusion == 'success' steps: + - name: Debug event data + run: | + echo '${{ github.event.workflow_run.id }}' + echo `${{ github.repository }}` - name: Download Artifacts uses: actions/download-artifact@v4 with: