@@ -34,16 +34,34 @@ jobs:
34
34
35
35
- name : Compute coverage
36
36
working-directory : ${{env.COVERAGE_DIR}}
37
+ id : coverage
37
38
run : |
38
39
echo "DIR: $(pwd)" && ls -al
39
40
../scripts/coverage/merge_coverage_files.sh exports-coverage total_coverage
40
41
genhtml --no-function-coverage -o html_report total_coverage 2>&1 | tee output.txt
41
42
mkdir coverage_report
42
43
mv html_report ./coverage_report/
43
44
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
44
46
45
47
- name : Upload coverage report
46
48
uses : actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
47
49
with :
48
50
name : coverage_html_report
49
51
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