Skip to content

Commit 97d077e

Browse files
test cov badge
1 parent b8088be commit 97d077e

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

.github/workflows/pr_push.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ jobs:
5757
if: github.repository == 'oneapi-src/unified-memory-framework'
5858
needs: [Build, DevDax, GPU, MultiNuma, Qemu, ProxyLib]
5959
uses: ./.github/workflows/reusable_coverage.yml
60+
secrets: inherit
6061
Coverage_partial:
6162
# partial coverage (on forks)
6263
if: github.repository != 'oneapi-src/unified-memory-framework'

.github/workflows/reusable_coverage.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,34 @@ jobs:
3434

3535
- name: Compute coverage
3636
working-directory: ${{env.COVERAGE_DIR}}
37+
id: coverage
3738
run: |
3839
echo "DIR: $(pwd)" && ls -al
3940
../scripts/coverage/merge_coverage_files.sh exports-coverage total_coverage
4041
genhtml --no-function-coverage -o html_report total_coverage 2>&1 | tee output.txt
4142
mkdir coverage_report
4243
mv html_report ./coverage_report/
4344
tail -n2 output.txt >> $GITHUB_STEP_SUMMARY
45+
echo "COV_OUT=$(tail -n1 output.txt | grep -oP "lines[.]+: [\d.]+%" | cut -d ' ' -f2 | tr -d '%')" >> $GITHUB_OUTPUT
4446
4547
- name: Upload coverage report
4648
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
4749
with:
4850
name: coverage_html_report
4951
path: coverage/coverage_report
52+
53+
# XXX: add check to only update on merge!!!
54+
# preview of the badge: https://gist.github.com/bb-ur/3f66c77d7035df39aa75dda8a2ac75b3
55+
# Only update the badge on merge in upstream and if build is successful
56+
- name: Update coverity badge
57+
if: ${{ success() && github.repository == 'oneapi-src/unified-memory-framework' }}
58+
uses: Schneegans/dynamic-badges-action@e9a478b16159b4d31420099ba146cdc50f134483 # v1.7.0
59+
with:
60+
auth: ${{ secrets.BB_GIST_TOKEN }}
61+
gistID: 3f66c77d7035df39aa75dda8a2ac75b3
62+
filename: umf_coverage_badge.svg
63+
label: Coverage
64+
message: ${{ steps.coverage.outputs.COV_OUT }}%
65+
valColorRange: ${{ steps.coverage.outputs.COV_OUT }}
66+
minColorRange: 50 # <= this value = color: red
67+
maxColorRange: 90 # >= this value = color: green

0 commit comments

Comments
 (0)