ci: Enable ISPC tests on Linux, Windows, and macOS nightly builds

This commit is contained in:
Brad King 2022-06-06 13:17:54 -04:00
parent 49996faaac
commit d14349c907
16 changed files with 102 additions and 0 deletions

View File

@ -73,6 +73,9 @@ set(CMake_TEST_Fortran_SUBMODULES "ON" CACHE BOOL "")
set(CMake_TEST_IPO_WORKS_C "ON" CACHE BOOL "")
set(CMake_TEST_IPO_WORKS_CXX "ON" CACHE BOOL "")
set(CMake_TEST_IPO_WORKS_Fortran "ON" CACHE BOOL "")
if (NOT "$ENV{CMAKE_CI_NIGHTLY}" STREQUAL "")
set(CMake_TEST_ISPC "ON" CACHE STRING "")
endif()
set(CMake_TEST_Qt5 "ON" CACHE BOOL "")
set(CMake_TEST_UseSWIG "ON" CACHE BOOL "")

View File

@ -1,4 +1,7 @@
set(CMake_TEST_GUI "ON" CACHE BOOL "")
if (NOT "$ENV{CMAKE_CI_NIGHTLY}" STREQUAL "")
set(CMake_TEST_ISPC "ON" CACHE STRING "")
endif()
# "Release" flags without "-DNDEBUG" so we get assertions.
set(CMAKE_C_FLAGS_RELEASE "-O3" CACHE STRING "")

View File

@ -1 +1,5 @@
if (NOT "$ENV{CMAKE_CI_NIGHTLY}" STREQUAL "")
set(CMake_TEST_ISPC "ON" CACHE STRING "")
endif()
include("${CMAKE_CURRENT_LIST_DIR}/configure_external_test.cmake")

View File

@ -1,3 +1,7 @@
set(CMake_TEST_GUI "ON" CACHE BOOL "")
if (NOT "$ENV{CMAKE_CI_NIGHTLY}" STREQUAL "")
set(CMake_TEST_ISPC "ON" CACHE STRING "")
endif()
include("${CMAKE_CURRENT_LIST_DIR}/configure_macos_common.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/configure_common.cmake")

View File

@ -1,3 +1,7 @@
set(CMake_TEST_GUI "ON" CACHE BOOL "")
if (NOT "$ENV{CMAKE_CI_NIGHTLY}" STREQUAL "")
set(CMake_TEST_ISPC "ON" CACHE STRING "")
endif()
include("${CMAKE_CURRENT_LIST_DIR}/configure_macos_common.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/configure_common.cmake")

View File

@ -1 +1,5 @@
if (NOT "$ENV{CMAKE_CI_NIGHTLY}" STREQUAL "")
set(CMake_TEST_ISPC "ON" CACHE STRING "")
endif()
include("${CMAKE_CURRENT_LIST_DIR}/configure_windows_vs_common_ninja.cmake")

View File

@ -0,0 +1,3 @@
if test "$CMAKE_CI_NIGHTLY" = "true"; then
source .gitlab/ci/ispc-env.sh
fi

View File

@ -0,0 +1,3 @@
if test "$CMAKE_CI_NIGHTLY" = "true"; then
source .gitlab/ci/ispc-env.sh
fi

View File

@ -0,0 +1,3 @@
if test "$CMAKE_CI_NIGHTLY" = "true"; then
source .gitlab/ci/ispc-env.sh
fi

View File

@ -0,0 +1,3 @@
if test "$CMAKE_CI_NIGHTLY" = "true"; then
source .gitlab/ci/ispc-env.sh
fi

View File

@ -0,0 +1,3 @@
if test "$CMAKE_CI_NIGHTLY" = "true"; then
source .gitlab/ci/ispc-env.sh
fi

View File

@ -0,0 +1,3 @@
if ("$env:CMAKE_CI_NIGHTLY" -eq "true") {
Invoke-Expression ".gitlab/ci/ispc-env.ps1"
}

4
.gitlab/ci/ispc-env.ps1 Executable file
View File

@ -0,0 +1,4 @@
$pwdpath = $pwd.Path
powershell -File ".gitlab/ci/ispc.ps1"
Set-Item -Force -Path "env:PATH" -Value "$pwdpath\.gitlab\ispc\bin;$env:PATH"
ispc --version

3
.gitlab/ci/ispc-env.sh Normal file
View File

@ -0,0 +1,3 @@
.gitlab/ci/ispc.sh
export PATH=$PWD/.gitlab/ispc/bin:$PATH
ispc --version

19
.gitlab/ci/ispc.ps1 Executable file
View File

@ -0,0 +1,19 @@
$erroractionpreference = "stop"
$version = "1.18.0"
$sha256sum = "9210BB2D9D3711367FACCB37ACF49966696132560B565471C1C6121F4924A17E"
$filename = "ispc-v$version-windows"
$tarball = "$filename.zip"
$outdir = $pwd.Path
$outdir = "$outdir\.gitlab"
$ProgressPreference = 'SilentlyContinue'
Invoke-WebRequest -Uri "https://github.com/ispc/ispc/releases/download/v$version/$tarball" -OutFile "$outdir\$tarball"
$hash = Get-FileHash "$outdir\$tarball" -Algorithm SHA256
if ($hash.Hash -ne $sha256sum) {
exit 1
}
Add-Type -AssemblyName System.IO.Compression.FileSystem
[System.IO.Compression.ZipFile]::ExtractToDirectory("$outdir\$tarball", "$outdir")
Move-Item -Path "$outdir\$filename" -Destination "$outdir\ispc"

36
.gitlab/ci/ispc.sh Executable file
View File

@ -0,0 +1,36 @@
#!/bin/sh
set -e
readonly version="1.18.0"
case "$(uname -s)-$(uname -m)" in
Linux-x86_64)
shatool="sha256sum"
sha256sum="6c379bb97962e9de7d24fd48b3f7e647dc42be898e9d187948220268c646b692"
platform="linux"
;;
Darwin-x86_64)
shatool="shasum -a 256"
sha256sum="d1435b541182406ff6b18446d31ecceef0eae3aed7654391ae676d3142e0000d"
platform="macOS"
;;
*)
echo "Unrecognized platform $(uname -s)-$(uname -m)"
exit 1
;;
esac
readonly shatool
readonly sha256sum
readonly platform
readonly filename="ispc-v$version-$platform"
readonly tarball="$filename.tar.gz"
cd .gitlab
echo "$sha256sum $tarball" > ispc.sha256sum
curl -OL "https://github.com/ispc/ispc/releases/download/v$version/$tarball"
$shatool --check ispc.sha256sum
tar xf "$tarball"
mv "$filename" ispc