ci: Add scripts to install PVS-Studio in Linux jobs

This commit is contained in:
Brad King
2026-04-29 18:22:36 -04:00
parent 3748deda58
commit b7105edd72
3 changed files with 47 additions and 0 deletions
+1
View File
@@ -20,6 +20,7 @@
/open-watcom* /open-watcom*
/orangec /orangec
/pellesc /pellesc
/pvs-studio
/python* /python*
/qt* /qt*
/sccache* /sccache*
+13
View File
@@ -0,0 +1,13 @@
.gitlab/ci/pvs-studio.sh
export PATH=$PWD/.gitlab/pvs-studio/bin:$PATH
pvs-studio --version
if test -f "$CMAKE_CI_PVS_STUDIO_LICENSE_USER" -a -f "$CMAKE_CI_PVS_STUDIO_LICENSE_KEY"; then
pvs-studio-analyzer credentials "$(<"$CMAKE_CI_PVS_STUDIO_LICENSE_USER")" "$(<"$CMAKE_CI_PVS_STUDIO_LICENSE_KEY")"
else
echo "The CMAKE_CI_PVS_STUDIO_LICENSE_USER and CMAKE_CI_PVS_STUDIO_LICENSE_KEY files were not both provided!"
exit 1
fi
rm -f "$CMAKE_CI_PVS_STUDIO_LICENSE_USER" "$CMAKE_CI_PVS_STUDIO_LICENSE_KEY"
unset CMAKE_CI_PVS_STUDIO_LICENSE_KEY
unset CMAKE_CI_PVS_STUDIO_LICENSE_USER
+33
View File
@@ -0,0 +1,33 @@
#!/bin/sh
set -e
readonly version="7.42.105112.761"
case "$(uname -s)-$(uname -m)" in
Linux-x86_64)
# https://files.pvs-studio.com/pvs-studio-7.42.105112.761-x86_64.tgz
shatool="sha256sum"
sha256sum="0ced11d17855cc172a860f8cc19a89f10adb6ab7185992fb57474118e9bdabd7"
filename="pvs-studio-$version-x86_64"
;;
*)
echo "Unrecognized platform $(uname -s)-$(uname -m)"
exit 1
;;
esac
readonly shatool
readonly sha256sum
cd .gitlab
# This URL is only visible inside of Kitware's network. See above filename table.
baseurl="https://cmake.org/files/dependencies/internal"
tarball="$filename.tgz"
echo "$sha256sum $tarball" > pvs-studio.sha256sum
curl -OL "$baseurl/$tarball"
$shatool --check pvs-studio.sha256sum
tar xzf "$tarball"
rm "$tarball" pvs-studio.sha256sum
mv "$filename" "pvs-studio"