Skip to content

Commit 08bc44e

Browse files
committed
way less commenting
1 parent e738c13 commit 08bc44e

1 file changed

Lines changed: 1 addition & 43 deletions

File tree

.github/workflows/coverity.yml

Lines changed: 1 addition & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,8 @@
11
name: Coverity Scan
22

3-
# Public static analysis via the free Coverity Scan service (scan.coverity.com,
4-
# operated by Black Duck). Coverity is a compiled-language analyzer: it must wrap
5-
# the real C build with `cov-build`, so this workflow installs the toolchain,
6-
# compiles the extensions under capture, and uploads the result.
7-
#
8-
# This project must be built with Intel icx, not gcc: CMakeLists.txt applies
9-
# -fveclib=SVML, -fvectorize and -fimf-precision=high unconditionally, and gcc
10-
# rejects all three. That mirrors build-with-clang.yml and the conda recipe.
11-
#
12-
# One-time setup (done once per project, outside this workflow):
13-
# 1. Register IntelPython/mkl_umath at https://scan.coverity.com/github
14-
# (the project name must match COVERITY_PROJECT below).
15-
# 2. Add two repository secrets (Settings -> Secrets and variables -> Actions):
16-
# COVERITY_SCAN_TOKEN - the project token from the Project Settings tab
17-
# COVERITY_SCAN_EMAIL - a maintainer email for build notifications
18-
#
19-
# Free-tier quota for a project under 100K LOC is 28 builds/week, max 4/day, so
20-
# this runs on a weekly schedule plus on demand rather than per-push.
21-
223
on:
234
schedule:
24-
- cron: "0 1 * * 1" # Mondays 01:00 UTC; well under the free build quota
5+
- cron: "0 1 * * 1"
256
workflow_dispatch:
267

278
permissions:
@@ -37,11 +18,8 @@ env:
3718

3819
jobs:
3920
coverity-scan:
40-
# Forks lack the COVERITY_SCAN_* secrets; only run on the canonical repo.
4121
if: github.repository == 'IntelPython/mkl_umath'
4222
runs-on: ubuntu-latest
43-
# backstop timeout for whole job; larger than the sibling projects because
44-
# this one also has to apt-install the oneAPI compiler and MKL.
4523
timeout-minutes: 90
4624

4725
steps:
@@ -63,8 +41,6 @@ jobs:
6341
sudo apt-get update
6442
6543
- name: Install Intel oneAPI
66-
# Multi-GB apt download; cap it so a stalled mirror fails here with a
67-
# clear culprit rather than eating the whole job budget.
6844
timeout-minutes: 25
6945
run: |
7046
sudo apt-get install -y intel-oneapi-compiler-dpcpp-cpp
@@ -83,37 +59,19 @@ jobs:
8359
--data-urlencode "project=${COVERITY_PROJECT}" \
8460
--output cov-analysis.tar.gz \
8561
https://scan.coverity.com/download/linux64
86-
# An invalid token/project returns a small HTML error page, not the
87-
# multi-hundred-MB tarball. Fail loudly with a clear hint if so.
88-
if [ "$(stat -c '%s' cov-analysis.tar.gz)" -lt 1000000 ]; then
89-
echo "::error::Coverity build tool download failed. Verify the COVERITY_SCAN_TOKEN secret and that the registered project name matches '${COVERITY_PROJECT}'."
90-
head -c 512 cov-analysis.tar.gz || true
91-
exit 1
92-
fi
9362
mkdir -p cov-analysis
9463
tar -xzf cov-analysis.tar.gz --strip 1 -C cov-analysis
9564
echo "${PWD}/cov-analysis/bin" >> "$GITHUB_PATH"
9665
9766
- name: Build under cov-build
98-
# cov-build wraps the compiler and can wedge without producing output;
99-
# cap it so a hang fails fast instead of idling until the job timeout.
100-
# 4 translation units under icx normally finish in a few minutes.
10167
timeout-minutes: 20
10268
run: |
10369
# shellcheck disable=SC1091
10470
source "${ONEAPI_ROOT}/setvars.sh"
10571
export CC="${CMPLR_ROOT}/bin/icx"
106-
# icx is clang-based but not auto-configured like gcc, so teach the
107-
# Coverity front-end about it before capturing the build.
10872
cov-configure --template --comptype clangcc --compiler "${CC}"
109-
# scikit-build caches its CMake tree in _skbuild and will skip
110-
# recompiling translation units that are already up to date, which
111-
# under-reports (or empties) the Coverity emit. Force a real rebuild.
11273
rm -rf _skbuild
11374
cov-build --dir cov-int pip install . --no-build-isolation --no-deps 2>&1 | tee cov-build.log
114-
# The project has 4 C translation units (mkl_umath_loops.c,
115-
# ufuncsmodule.c, generated __umath_generated.c and Cython
116-
# _patch_numpy.c); bail out if none were captured.
11775
if ! grep -qE "Emitted [1-9][0-9]* .*compilation unit" cov-build.log; then
11876
echo "::error::Coverity captured 0 compilation units — the C build did not run under cov-build."
11977
exit 1

0 commit comments

Comments
 (0)