Skip to content

Commit c6effe4

Browse files
committed
task: coverity scanning
1 parent 9165494 commit c6effe4

2 files changed

Lines changed: 81 additions & 0 deletions

File tree

.github/workflows/coverity.yml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: Coverity Scan
2+
3+
on:
4+
schedule:
5+
- cron: "0 1 * * 1"
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
11+
concurrency:
12+
group: coverity-${{ github.ref }}
13+
cancel-in-progress: true
14+
15+
env:
16+
COVERITY_PROJECT: IntelPython/mkl_fft
17+
18+
jobs:
19+
coverity-scan:
20+
if: github.repository == 'IntelPython/mkl_fft'
21+
runs-on: ubuntu-latest
22+
timeout-minutes: 60
23+
24+
steps:
25+
- name: Checkout repo
26+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
27+
28+
- name: Setup Python
29+
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
30+
with:
31+
python-version: "3.12"
32+
architecture: x64
33+
34+
- name: Install mkl_fft dependencies
35+
run: pip install meson-python ninja cmake cython "numpy>=2" mkl-devel
36+
37+
- name: Download Coverity Build Tool
38+
timeout-minutes: 15
39+
env:
40+
COVERITY_SCAN_TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }}
41+
run: |
42+
curl --location --no-progress-meter --fail-with-body \
43+
--retry 5 --retry-connrefused --retry-delay 5 \
44+
--data-urlencode "token=${COVERITY_SCAN_TOKEN}" \
45+
--data-urlencode "project=${COVERITY_PROJECT}" \
46+
--output cov-analysis.tar.gz \
47+
https://scan.coverity.com/download/linux64
48+
mkdir -p cov-analysis
49+
tar -xzf cov-analysis.tar.gz --strip 1 -C cov-analysis
50+
echo "${PWD}/cov-analysis/bin" >> "$GITHUB_PATH"
51+
52+
- name: Configure Coverity for GCC
53+
run: cov-configure --gcc
54+
55+
- name: Build under cov-build
56+
timeout-minutes: 20
57+
run: |
58+
rm -rf build
59+
cov-build --dir cov-int pip install -e . --no-build-isolation --no-deps 2>&1 | tee cov-build.log
60+
if ! grep -qE "Emitted [1-9][0-9]* .*compilation unit" cov-build.log; then
61+
echo "::error::Coverity captured 0 compilation units — the C build did not run under cov-build."
62+
exit 1
63+
fi
64+
65+
- name: Submit results to Coverity Scan
66+
timeout-minutes: 15
67+
env:
68+
COVERITY_SCAN_TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }}
69+
COVERITY_SCAN_EMAIL: ${{ secrets.COVERITY_SCAN_EMAIL }}
70+
run: |
71+
tar -czf cov-int.tgz cov-int
72+
curl --no-progress-meter --fail-with-body \
73+
--retry 5 --retry-connrefused --retry-delay 5 \
74+
--form token="${COVERITY_SCAN_TOKEN}" \
75+
--form email="${COVERITY_SCAN_EMAIL}" \
76+
--form file=@cov-int.tgz \
77+
--form version="${GITHUB_SHA}" \
78+
--form description="GitHub Actions ${GITHUB_REF_NAME} (run ${GITHUB_RUN_ID})" \
79+
--form project="${COVERITY_PROJECT}" \
80+
https://scan.coverity.com/builds

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
[![Editable build using pip and pre-release NumPy](https://github.com/IntelPython/mkl_fft/actions/workflows/build_pip.yml/badge.svg)](https://github.com/IntelPython/mkl_fft/actions/workflows/build_pip.yml)
33
[![Conda package with conda-forge channel only](https://github.com/IntelPython/mkl_fft/actions/workflows/conda-package-cf.yml/badge.svg)](https://github.com/IntelPython/mkl_fft/actions/workflows/conda-package-cf.yml)
44
[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/IntelPython/mkl_fft/badge)](https://securityscorecards.dev/viewer/?uri=github.com/IntelPython/mkl_fft)
5+
[![Coverity Scan Build Status](https://scan.coverity.com/projects/33202/badge.svg)](https://scan.coverity.com/projects/intelpython-mkl_fft)
56

67
## `mkl_fft` -- a NumPy-based Python interface to Intel® oneAPI Math Kernel Library (oneMKL) Fourier Transform Functions
78

0 commit comments

Comments
 (0)