Skip to content

Commit 78fce8b

Browse files
Restore tarball size check in coverity.yml and use errorlevel 1 in bld.bat
1 parent 57bad0b commit 78fce8b

2 files changed

Lines changed: 12 additions & 5 deletions

File tree

‎.github/workflows/coverity.yml‎

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,19 @@ jobs:
5757
env:
5858
COVERITY_SCAN_TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }}
5959
run: |
60-
curl --location --no-progress-meter --fail-with-body \
60+
curl --location --no-progress-meter \
6161
--retry 5 --retry-connrefused --retry-delay 5 \
6262
--data-urlencode "token=${COVERITY_SCAN_TOKEN}" \
6363
--data-urlencode "project=${COVERITY_PROJECT}" \
6464
--output cov-analysis.tar.gz \
6565
https://scan.coverity.com/download/linux64
66+
# An invalid token/project returns a small HTML error page, not the
67+
# multi-hundred-MB tarball. Fail loudly with a clear hint if so.
68+
if [ "$(stat -c '%s' cov-analysis.tar.gz)" -lt 1000000 ]; then
69+
echo "::error::Coverity build tool download failed. Verify the COVERITY_SCAN_TOKEN secret and that the registered project name matches '${COVERITY_PROJECT}'."
70+
head -c 512 cov-analysis.tar.gz || true
71+
exit 1
72+
fi
6673
mkdir -p cov-analysis
6774
tar -xzf cov-analysis.tar.gz --strip 1 -C cov-analysis
6875
echo "${PWD}/cov-analysis/bin" >> "$GITHUB_PATH"
@@ -95,7 +102,7 @@ jobs:
95102
COVERITY_SCAN_EMAIL: ${{ secrets.COVERITY_SCAN_EMAIL }}
96103
run: |
97104
tar -czf cov-int.tgz cov-int
98-
curl --no-progress-meter --fail-with-body \
105+
curl --no-progress-meter \
99106
--retry 5 --retry-connrefused --retry-delay 5 \
100107
--form token="${COVERITY_SCAN_TOKEN}" \
101108
--form email="${COVERITY_SCAN_EMAIL}" \

‎conda-recipe/bld.bat‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
:: -wnx flags mean: --wheel --no-isolation --skip-dependency-check
22
:: -Ccompile-args=-v makes ninja print full compiler commands (verbose build)
33
%PYTHON% -m build -w -n -x -Ccompile-args=-v
4-
if %ERRORLEVEL% neq 0 exit 1
4+
if errorlevel 1 exit 1
55

66
for /f %%f in ('dir /b /S .\dist') do (
77
%PYTHON% -m pip install %%f ^
@@ -11,10 +11,10 @@ for /f %%f in ('dir /b /S .\dist') do (
1111
--no-index ^
1212
--prefix %PREFIX% ^
1313
-vv
14-
if %ERRORLEVEL% neq 0 exit 1
14+
if errorlevel 1 exit 1
1515
)
1616

1717
if NOT "%WHEELS_OUTPUT_FOLDER%"=="" (
1818
copy dist\mkl_random*.whl %WHEELS_OUTPUT_FOLDER%
19-
if %ERRORLEVEL% neq 0 exit 1
19+
if errorlevel 1 exit 1
2020
)

0 commit comments

Comments
 (0)