-
Notifications
You must be signed in to change notification settings - Fork 8
task: coverity #245
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
jharlow-intel
wants to merge
1
commit into
main
Choose a base branch
from
task/coverity
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+97
−0
Open
task: coverity #245
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,96 @@ | ||
| name: Coverity Scan | ||
|
|
||
| on: | ||
| schedule: | ||
| - cron: "0 1 * * 1" | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| concurrency: | ||
| group: coverity-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| env: | ||
| COVERITY_PROJECT: IntelPython/mkl_umath | ||
| ONEAPI_ROOT: /opt/intel/oneapi | ||
|
|
||
| jobs: | ||
| coverity-scan: | ||
| if: github.repository == 'IntelPython/mkl_umath' | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 90 | ||
|
|
||
| steps: | ||
| - name: Checkout repo | ||
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | ||
|
|
||
| - name: Setup Python | ||
| uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 | ||
| with: | ||
| python-version: "3.12" | ||
| architecture: x64 | ||
|
|
||
| - name: Add Intel repository | ||
| run: | | ||
| wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB | ||
| sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB | ||
| rm GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB | ||
| sudo add-apt-repository "deb https://apt.repos.intel.com/oneapi all main" | ||
| sudo apt-get update | ||
|
|
||
| - name: Install Intel oneAPI | ||
| timeout-minutes: 25 | ||
| run: | | ||
| sudo apt-get install -y intel-oneapi-compiler-dpcpp-cpp | ||
| sudo apt-get install -y intel-oneapi-mkl-devel | ||
|
|
||
| - name: Install mkl_umath dependencies | ||
| run: pip install scikit-build cmake ninja cython "setuptools>=77" "numpy>=2" | ||
|
|
||
| - name: Download Coverity Build Tool | ||
| timeout-minutes: 15 | ||
| env: | ||
| COVERITY_SCAN_TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }} | ||
| run: | | ||
| curl --location --no-progress-meter --fail-with-body \ | ||
| --retry 5 --retry-connrefused --retry-delay 5 \ | ||
| --data-urlencode "token=${COVERITY_SCAN_TOKEN}" \ | ||
| --data-urlencode "project=${COVERITY_PROJECT}" \ | ||
| --output cov-analysis.tar.gz \ | ||
| https://scan.coverity.com/download/linux64 | ||
| mkdir -p cov-analysis | ||
| tar -xzf cov-analysis.tar.gz --strip 1 -C cov-analysis | ||
| echo "${PWD}/cov-analysis/bin" >> "$GITHUB_PATH" | ||
|
|
||
| - name: Build under cov-build | ||
| timeout-minutes: 20 | ||
| run: | | ||
| # shellcheck disable=SC1091 | ||
| source "${ONEAPI_ROOT}/setvars.sh" | ||
| export CC="${CMPLR_ROOT}/bin/icx" | ||
| cov-configure --template --comptype clangcc --compiler "${CC}" | ||
| rm -rf _skbuild | ||
| cov-build --dir cov-int pip install . --no-build-isolation --no-deps 2>&1 | tee cov-build.log | ||
| if ! grep -qE "Emitted [1-9][0-9]* .*compilation unit" cov-build.log; then | ||
| echo "::error::Coverity captured 0 compilation units — the C build did not run under cov-build." | ||
| exit 1 | ||
| fi | ||
|
|
||
| - name: Submit results to Coverity Scan | ||
| timeout-minutes: 15 | ||
| env: | ||
| COVERITY_SCAN_TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }} | ||
| COVERITY_SCAN_EMAIL: ${{ secrets.COVERITY_SCAN_EMAIL }} | ||
| run: | | ||
| tar -czf cov-int.tgz cov-int | ||
| curl --no-progress-meter --fail-with-body \ | ||
| --retry 5 --retry-connrefused --retry-delay 5 \ | ||
| --form token="${COVERITY_SCAN_TOKEN}" \ | ||
| --form email="${COVERITY_SCAN_EMAIL}" \ | ||
| --form file=@cov-int.tgz \ | ||
| --form version="${GITHUB_SHA}" \ | ||
| --form description="GitHub Actions ${GITHUB_REF_NAME} (run ${GITHUB_RUN_ID})" \ | ||
| --form project="${COVERITY_PROJECT}" \ | ||
| https://scan.coverity.com/builds | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems we have to adopt to meson-build, because the appropriate PR is already merged.