From fcd121872e903c9cfa410537302eb16605fc5938 Mon Sep 17 00:00:00 2001 From: Andre Kurait Date: Wed, 20 Nov 2024 15:37:31 -0600 Subject: [PATCH] Test tokenless upload Signed-off-by: Andre Kurait --- .github/workflows/CI.yml | 39 ++++++++++ .github/workflows/codecov-publish.yml | 108 +++++++++++++------------- 2 files changed, 93 insertions(+), 54 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 4c6e1c36eb..9f14921d6b 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -235,6 +235,45 @@ jobs: env: GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + codecov-test: + needs: + - console-python-tests + - workflow-info + runs-on: ubuntu-latest + strategy: + matrix: + iteration: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20] + steps: + - name: Download Workflow Info + uses: actions/download-artifact@v4 + with: + name: workflow-info + - name: Set Environment Variables from JSON + run: | + ls + for key in $(jq -r 'keys[]' ./workflow-info.json); do + value=$(jq -r --arg key "$key" '.[$key]' ./workflow-info.json) + echo "workflow-info_$key=$value" + echo "workflow-info_$key=$value" >> $GITHUB_ENV + done + - name: Download Coverage Artifacts + uses: actions/download-artifact@v4 + with: + path: ./coverage-reports + pattern: coverage-reports-* + - name: Upload coverage report + uses: codecov/codecov-action@v5 + with: + fail_ci_if_error: true + files: /**/coverage-reports/**/*.* + flags: unittests + override_branch: ${{ env.workflow-info_branch }} + override_commit: ${{ env.workflow-info_commit }} + override_pr: ${{ env.workflow-info_pr_number }} + commit_parent: ${{ env.workflow-info_commit_parent }} + override_build_url: ${{ env.workflow-info_build_url }} + override_build: ${{ env.workflow-info_build }} + verbose: true all-ci-checks-pass: needs: diff --git a/.github/workflows/codecov-publish.yml b/.github/workflows/codecov-publish.yml index 23c666b8ef..0e550e6826 100644 --- a/.github/workflows/codecov-publish.yml +++ b/.github/workflows/codecov-publish.yml @@ -1,58 +1,58 @@ -name: Codecov Publish +# name: Codecov Publish -# Due to the behavior of workflow_run, changes to this file will -# only be reflected once it is pushed up to the `default` (main) branch -# -# It is recommended to test changes to this file by pushing to the default branch -# on a fork and evaluating the correctness of the action execution +# # Due to the behavior of workflow_run, changes to this file will +# # only be reflected once it is pushed up to the `default` (main) branch +# # +# # It is recommended to test changes to this file by pushing to the default branch +# # on a fork and evaluating the correctness of the action execution -on: - workflow_run: - workflows: [CI] - types: - - completed +# on: +# workflow_run: +# workflows: [CI] +# types: +# - completed -jobs: - publish-codecov: - if: ${{ github.event.workflow_run.conclusion == 'success' }} - runs-on: ubuntu-latest - steps: - - name: Download Workflow Info - uses: actions/download-artifact@v4 - with: - # Needed for cross run downloading - github-token: ${{ secrets.GITHUB_TOKEN }} - name: workflow-info - run-id: ${{ github.event.workflow_run.id }} - - name: Set Environment Variables from JSON - run: | - ls - # Read the JSON file and export each key-value pair as an environment variable - for key in $(jq -r 'keys[]' ./workflow-info.json); do - value=$(jq -r --arg key "$key" '.[$key]' ./workflow-info.json) - echo "workflow-info_$key=$value" - echo "workflow-info_$key=$value" >> $GITHUB_ENV - done - - name: Download Coverage Artifacts - uses: actions/download-artifact@v4 - with: - # Needed for cross run downloading - github-token: ${{ secrets.GITHUB_TOKEN }} - path: ./coverage-reports - pattern: coverage-reports-* - run-id: ${{ github.event.workflow_run.id }} +# jobs: +# publish-codecov: +# if: ${{ github.event.workflow_run.conclusion == 'success' }} +# runs-on: ubuntu-latest +# steps: +# - name: Download Workflow Info +# uses: actions/download-artifact@v4 +# with: +# # Needed for cross run downloading +# github-token: ${{ secrets.GITHUB_TOKEN }} +# name: workflow-info +# run-id: ${{ github.event.workflow_run.id }} +# - name: Set Environment Variables from JSON +# run: | +# ls +# # Read the JSON file and export each key-value pair as an environment variable +# for key in $(jq -r 'keys[]' ./workflow-info.json); do +# value=$(jq -r --arg key "$key" '.[$key]' ./workflow-info.json) +# echo "workflow-info_$key=$value" +# echo "workflow-info_$key=$value" >> $GITHUB_ENV +# done +# - name: Download Coverage Artifacts +# uses: actions/download-artifact@v4 +# with: +# # Needed for cross run downloading +# github-token: ${{ secrets.GITHUB_TOKEN }} +# path: ./coverage-reports +# pattern: coverage-reports-* +# run-id: ${{ github.event.workflow_run.id }} - - name: Upload coverage report - uses: codecov/codecov-action@v4 - with: - fail_ci_if_error: true - files: /**/coverage-reports/**/*.* - flags: unittests - override_branch: ${{ env.workflow-info_branch }} - override_commit: ${{ env.workflow-info_commit }} - override_pr: ${{ env.workflow-info_pr_number }} - commit_parent: ${{ env.workflow-info_commit_parent }} - override_build_url: ${{ env.workflow-info_build_url }} - override_build: ${{ env.workflow-info_build }} - token: ${{ secrets.CODECOV_TOKEN }} - verbose: true +# - name: Upload coverage report +# uses: codecov/codecov-action@v4 +# with: +# fail_ci_if_error: true +# files: /**/coverage-reports/**/*.* +# flags: unittests +# override_branch: ${{ env.workflow-info_branch }} +# override_commit: ${{ env.workflow-info_commit }} +# override_pr: ${{ env.workflow-info_pr_number }} +# commit_parent: ${{ env.workflow-info_commit_parent }} +# override_build_url: ${{ env.workflow-info_build_url }} +# override_build: ${{ env.workflow-info_build }} +# token: ${{ secrets.CODECOV_TOKEN }} +# verbose: true