Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .github/workflows/coverity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,38 @@ jobs:
--form version="$COMMIT_ID" \
--form description="$BRANCH_NAME:$COMMIT_ID" \
https://scan.coverity.com/builds\?project\=oneapi-src%2Funified-memory-framework

outstanding:
name: Coverity outstanding defects
# checks results of the last completed analysis (the new submission is analyzed asynchronously)
if: github.repository == 'oneapi-src/unified-memory-framework'
runs-on: ubuntu-latest
steps:
- name: Check server-side analysis status
run: |
BADGE=https://scan.coverity.com/projects/29761/badge.svg
STATUS=$(curl -fsSL "$BADGE" | grep -oP '<text[^>]*>\K[^<]+' | tail -n 1)
if [ -z "$STATUS" ]; then
echo "::error::Could not read analysis status from $BADGE"
exit 1
fi
echo "Coverity Scan analysis status: $STATUS" | tee -a "$GITHUB_STEP_SUMMARY"
if [[ "$STATUS" == *fail* ]]; then
echo "::error::Coverity Scan server-side analysis failed"
exit 1
fi

- name: Check outstanding defects
if: ${{ !cancelled() }}
run: |
URL=https://scan.coverity.com/projects/oneapi-src-unified-memory-framework
COUNT=$(curl -fsSL "$URL" | grep -B1 '<dt>Outstanding</dt>' | grep -oP '<em>\K[0-9,]+' | tr -d ',')
if [ -z "$COUNT" ]; then
echo "::error::Could not read outstanding defects count from $URL"
exit 1
fi
echo "Outstanding Coverity defects: $COUNT ($URL)" | tee -a "$GITHUB_STEP_SUMMARY"
if [ "$COUNT" -gt 0 ]; then
echo "::error::$COUNT outstanding Coverity defect(s)"
exit 1
fi
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
[![GitHubPages](https://github.com/oneapi-src/unified-memory-framework/actions/workflows/docs.yml/badge.svg?branch=main)](https://github.com/oneapi-src/unified-memory-framework/actions/workflows/docs.yml)
[![Nightly](https://github.com/oneapi-src/unified-memory-framework/actions/workflows/nightly.yml/badge.svg?branch=main)](https://github.com/oneapi-src/unified-memory-framework/actions/workflows/nightly.yml)
[![Weekly](https://github.com/oneapi-src/unified-memory-framework/actions/workflows/weekly.yml/badge.svg)](https://github.com/oneapi-src/unified-memory-framework/actions/workflows/weekly.yml)
[![Coverity build](https://github.com/oneapi-src/unified-memory-framework/actions/workflows/coverity.yml/badge.svg?branch=main)](https://github.com/oneapi-src/unified-memory-framework/actions/workflows/coverity.yml)
[![Coverity report](https://scan.coverity.com/projects/29761/badge.svg?flat=0)](https://scan.coverity.com/projects/oneapi-src-unified-memory-framework)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why remove this? I believe it would be red if coverity scan on the server have failed

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed - now a single badge now checks the build, verifies a successful scan on the Coverity server, and checks for any outstanding issues

[![Coverity](https://github.com/oneapi-src/unified-memory-framework/actions/workflows/coverity.yml/badge.svg?branch=main)](https://github.com/oneapi-src/unified-memory-framework/actions/workflows/coverity.yml)
[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/oneapi-src/unified-memory-framework/badge)](https://securityscorecards.dev/viewer/?uri=github.com/oneapi-src/unified-memory-framework)

## Introduction
Expand Down
Loading