Skip to content

Commit

Permalink
Test tokenless upload
Browse files Browse the repository at this point in the history
Signed-off-by: Andre Kurait <[email protected]>
  • Loading branch information
AndreKurait committed Nov 20, 2024
1 parent 41e0b5d commit fcd1218
Show file tree
Hide file tree
Showing 2 changed files with 93 additions and 54 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
108 changes: 54 additions & 54 deletions .github/workflows/codecov-publish.yml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit fcd1218

Please sign in to comment.