Skip to content

Commit 94111d7

Browse files
glimchbDevin
andcommitted
ci: upload coverage to codecov.io
Add Codecov integration to the summary workflow to upload combined coverage report (ut_cov_total.info) for the spdk/spdk repository. - Use OIDC authentication (no static token needed) - Use override_commit to map coverage to the tested SPDK commit - Use disable_search to only upload the specified file - Add permissions block to gerrit-webhook-handler.yml so the id-token:write permission propagates to the summary workflow Generated with [Devin](https://cli.devin.ai/docs) Co-Authored-By: Devin <noreply@cognition.ai> Signed-off-by: Boris Glimcher <Boris.Glimcher@emc.com>
1 parent eed851c commit 94111d7

2 files changed

Lines changed: 21 additions & 0 deletions

File tree

.github/workflows/gerrit-webhook-handler.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ on:
3535
- wip-state-changed
3636
- private-state-changed
3737

38+
permissions:
39+
actions: write # Required for gh run cancel in patch_set_status
40+
id-token: write # Required for Codecov OIDC in the summary workflow
41+
contents: read
42+
3843
env:
3944
# TODO: Renable client_payload for workflow_dispatch
4045
client_payload: ${{ github.event.client_payload != '' && toJson(github.event.client_payload) || '' }}

.github/workflows/summary.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ on:
1313
type: string
1414
default: 'failure'
1515

16+
permissions:
17+
id-token: write # This is required for requesting the JWT
18+
contents: read # This is required for actions/checkout
19+
1620
jobs:
1721
merge_outputs:
1822
# 22.04 used on purpose; it has lcov+gcov versions that are compatible with what
@@ -53,13 +57,25 @@ jobs:
5357
sudo apt-get update && sudo apt-get install -y lcov python3-pandas
5458
./spdk/autorun_post.py -d ./_autorun_summary -r ./spdk
5559
echo "result=success" >> "$GITHUB_OUTPUT"
60+
echo "spdk_sha=$(git -C ./spdk rev-parse HEAD)" >> "$GITHUB_OUTPUT"
5661
5762
- name: Upload artifacts
5863
if: ${{ always() }}
5964
uses: actions/upload-artifact@v4.4.0
6065
with:
6166
name: _autorun_summary
6267
path: _autorun_summary
68+
69+
- name: Upload coverage to Codecov
70+
uses: codecov/codecov-action@v5.5.2
71+
with:
72+
fail_ci_if_error: true
73+
use_oidc: true
74+
disable_search: true
75+
files: ./_autorun_summary/ut_coverage/ut_cov_total.info
76+
override_commit: ${{ steps.autorun_post.outputs.spdk_sha }}
77+
slug: spdk/spdk
78+
6379
outputs:
6480
result: ${{ steps.autorun_post.outputs.result }}
6581

0 commit comments

Comments
 (0)