From 3e791592ad44a6d44599bda346c85983e6fe89eb Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 6 Jun 2022 12:40:11 -0400 Subject: gitlab-ci: init macOS and Windows jobs with per-CMAKE_CONFIGURATION scripts Apply the approach from commit 747940157f (gitlab-ci: init environment with per-CMAKE_CONFIGURATION shell scripts, 2021-03-12, v3.21.0-rc1~480^2~4) to macOS and Windows too. --- .gitlab/ci/env.ps1 | 3 +++ .gitlab/os-macos.yml | 1 + .gitlab/os-windows.yml | 2 ++ 3 files changed, 6 insertions(+) create mode 100755 .gitlab/ci/env.ps1 diff --git a/.gitlab/ci/env.ps1 b/.gitlab/ci/env.ps1 new file mode 100755 index 0000000..e24bc37 --- /dev/null +++ b/.gitlab/ci/env.ps1 @@ -0,0 +1,3 @@ +if (Test-Path -Path ".gitlab/ci/env_$env:CMAKE_CONFIGURATION.ps1" -PathType Leaf) { + Invoke-Expression ".gitlab/ci/env_$env:CMAKE_CONFIGURATION.ps1" +} diff --git a/.gitlab/os-macos.yml b/.gitlab/os-macos.yml index f36fe6d..da4757a 100644 --- a/.gitlab/os-macos.yml +++ b/.gitlab/os-macos.yml @@ -126,6 +126,7 @@ ## macOS-specific scripts .before_script_macos: &before_script_macos + - source .gitlab/ci/env.sh - .gitlab/ci/cmake.sh - export PATH=$PWD/.gitlab/cmake/bin:$PATH - .gitlab/ci/ninja.sh diff --git a/.gitlab/os-windows.yml b/.gitlab/os-windows.yml index e5febbe..be9ac6c 100644 --- a/.gitlab/os-windows.yml +++ b/.gitlab/os-windows.yml @@ -234,6 +234,7 @@ ## Windows-specific scripts .before_script_windows: &before_script_windows + - Invoke-Expression -Command .gitlab/ci/env.ps1 - $pwdpath = $pwd.Path - powershell -File ".gitlab/ci/wix.ps1" - Set-Item -Force -Path "env:WIX" -Value "$pwdpath\.gitlab\wix" @@ -292,6 +293,7 @@ stage: test-ext script: + - Invoke-Expression -Command .gitlab/ci/env.ps1 - build/install/bin/ctest --output-on-failure -V -S .gitlab/ci/ctest_standalone.cmake interruptible: true -- cgit v0.12 From 49996faaac552cf80cb2de53e0719bc6ba43432a Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 6 Jun 2022 15:06:07 -0400 Subject: ci: remove ISPC from the Fedora CI image Revert commit 5ece12b7e4 (gitlab-ci: add ISPC to the Fedora CI image, 2020-08-18, v3.19.0-rc1~244^2). Later we will download ISPC in specific jobs. Update a `RunCMake.NinjaMultiConfig` test expectation to account for a change to the Qt deployed on Fedora 36. --- .gitlab/ci/configure_fedora36_makefiles.cmake | 1 - .gitlab/ci/configure_fedora36_ninja.cmake | 1 - .gitlab/ci/configure_fedora36_ninja_multi.cmake | 1 - .gitlab/ci/docker/fedora36/Dockerfile | 3 --- .gitlab/ci/docker/fedora36/install_ispc.sh | 14 -------------- .gitlab/os-linux.yml | 2 +- Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake | 2 +- 7 files changed, 2 insertions(+), 22 deletions(-) delete mode 100755 .gitlab/ci/docker/fedora36/install_ispc.sh diff --git a/.gitlab/ci/configure_fedora36_makefiles.cmake b/.gitlab/ci/configure_fedora36_makefiles.cmake index 9dc5ca9..25df029 100644 --- a/.gitlab/ci/configure_fedora36_makefiles.cmake +++ b/.gitlab/ci/configure_fedora36_makefiles.cmake @@ -73,7 +73,6 @@ 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 "") -set(CMake_TEST_ISPC "ON" CACHE STRING "") set(CMake_TEST_Qt5 "ON" CACHE BOOL "") set(CMake_TEST_UseSWIG "ON" CACHE BOOL "") diff --git a/.gitlab/ci/configure_fedora36_ninja.cmake b/.gitlab/ci/configure_fedora36_ninja.cmake index 7e33513..7d5105d 100644 --- a/.gitlab/ci/configure_fedora36_ninja.cmake +++ b/.gitlab/ci/configure_fedora36_ninja.cmake @@ -1,4 +1,3 @@ -set(CMake_TEST_ISPC "ON" CACHE STRING "") set(CMake_TEST_GUI "ON" CACHE BOOL "") # "Release" flags without "-DNDEBUG" so we get assertions. diff --git a/.gitlab/ci/configure_fedora36_ninja_multi.cmake b/.gitlab/ci/configure_fedora36_ninja_multi.cmake index efb4b84..20863a2 100644 --- a/.gitlab/ci/configure_fedora36_ninja_multi.cmake +++ b/.gitlab/ci/configure_fedora36_ninja_multi.cmake @@ -1,2 +1 @@ -set(CMake_TEST_ISPC "ON" CACHE STRING "") include("${CMAKE_CURRENT_LIST_DIR}/configure_external_test.cmake") diff --git a/.gitlab/ci/docker/fedora36/Dockerfile b/.gitlab/ci/docker/fedora36/Dockerfile index cf6ded9..26f8e3e 100644 --- a/.gitlab/ci/docker/fedora36/Dockerfile +++ b/.gitlab/ci/docker/fedora36/Dockerfile @@ -10,9 +10,6 @@ MAINTAINER Ben Boeckel COPY install_deps.sh /root/install_deps.sh RUN sh /root/install_deps.sh -COPY install_ispc.sh /root/install_ispc.sh -RUN sh /root/install_ispc.sh - COPY --from=rvm-build /root/rvm.tar /root/rvm.tar RUN tar -C /usr/local -xf /root/rvm.tar \ && rm /root/rvm.tar diff --git a/.gitlab/ci/docker/fedora36/install_ispc.sh b/.gitlab/ci/docker/fedora36/install_ispc.sh deleted file mode 100755 index fdc14b5..0000000 --- a/.gitlab/ci/docker/fedora36/install_ispc.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh - -set -e - -readonly version="1.13.0" -readonly sha256sum="8ab1189bd5db596b3eee9d9465d3528b6626a7250675d67102761bb0d284cd21" - -readonly filename="ispc-v$version-linux" -readonly tarball="$filename.tar.gz" - -echo "$sha256sum $tarball" > ispc.sha256sum -curl -OL "https://github.com/ispc/ispc/releases/download/v$version/$tarball" -sha256sum --check ispc.sha256sum -tar --strip-components=1 -C /usr/local -xf "$tarball" "$filename/bin/ispc" diff --git a/.gitlab/os-linux.yml b/.gitlab/os-linux.yml index a822d94..0b2d382 100644 --- a/.gitlab/os-linux.yml +++ b/.gitlab/os-linux.yml @@ -69,7 +69,7 @@ ### Fedora .fedora36: - image: "kitware/cmake:ci-fedora36-x86_64-2022-05-17" + image: "kitware/cmake:ci-fedora36-x86_64-2022-06-06" variables: GIT_CLONE_PATH: "$CI_BUILDS_DIR/cmake ci/long file name for testing purposes" diff --git a/Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake b/Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake index 919015f..dbc3151 100644 --- a/Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake +++ b/Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake @@ -17,7 +17,7 @@ function(check_files dir) list(SORT expected) file(GLOB_RECURSE actual "${dir}/*") - list(FILTER actual EXCLUDE REGEX "/CMakeFiles/|\\.ninja$|/CMakeCache\\.txt$|/target_files[^/]*\\.cmake$|/\\.ninja_[^/]*$|/cmake_install\\.cmake$|\\.ilk$|\\.manifest$|\\.pdb$|\\.exp$|/install_manifest\\.txt$") + list(FILTER actual EXCLUDE REGEX "/CMakeFiles/|\\.ninja$|/CMakeCache\\.txt$|/target_files[^/]*\\.cmake$|/\\.ninja_[^/]*$|/cmake_install\\.cmake$|\\.ilk$|\\.manifest$|\\.pdb$|\\.exp$|/install_manifest\\.txt$|/\\.qt/QtDeploySupport[^/]*\\.cmake$") foreach(f IN LISTS _check_files_INCLUDE _check_files_EXCLUDE) if(EXISTS ${f}) list(APPEND actual ${f}) -- cgit v0.12 From d14349c907bae69fe06ade224d790e5113945bb2 Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 6 Jun 2022 13:17:54 -0400 Subject: ci: Enable ISPC tests on Linux, Windows, and macOS nightly builds --- .gitlab/ci/configure_fedora36_makefiles.cmake | 3 ++ .gitlab/ci/configure_fedora36_ninja.cmake | 3 ++ .gitlab/ci/configure_fedora36_ninja_multi.cmake | 4 +++ .gitlab/ci/configure_macos_x86_64_makefiles.cmake | 4 +++ .gitlab/ci/configure_macos_x86_64_ninja.cmake | 4 +++ .../ci/configure_windows_vs2022_x64_ninja.cmake | 4 +++ .gitlab/ci/env_fedora36_makefiles.sh | 3 ++ .gitlab/ci/env_fedora36_ninja.sh | 3 ++ .gitlab/ci/env_fedora36_ninja_multi.sh | 3 ++ .gitlab/ci/env_macos_x86_64_makefiles.sh | 3 ++ .gitlab/ci/env_macos_x86_64_ninja.sh | 3 ++ .gitlab/ci/env_windows_vs2022_x64_ninja.ps1 | 3 ++ .gitlab/ci/ispc-env.ps1 | 4 +++ .gitlab/ci/ispc-env.sh | 3 ++ .gitlab/ci/ispc.ps1 | 19 ++++++++++++ .gitlab/ci/ispc.sh | 36 ++++++++++++++++++++++ 16 files changed, 102 insertions(+) create mode 100644 .gitlab/ci/env_fedora36_makefiles.sh create mode 100644 .gitlab/ci/env_fedora36_ninja.sh create mode 100644 .gitlab/ci/env_fedora36_ninja_multi.sh create mode 100644 .gitlab/ci/env_macos_x86_64_makefiles.sh create mode 100644 .gitlab/ci/env_macos_x86_64_ninja.sh create mode 100755 .gitlab/ci/env_windows_vs2022_x64_ninja.ps1 create mode 100755 .gitlab/ci/ispc-env.ps1 create mode 100644 .gitlab/ci/ispc-env.sh create mode 100755 .gitlab/ci/ispc.ps1 create mode 100755 .gitlab/ci/ispc.sh diff --git a/.gitlab/ci/configure_fedora36_makefiles.cmake b/.gitlab/ci/configure_fedora36_makefiles.cmake index 25df029..c5b5190 100644 --- a/.gitlab/ci/configure_fedora36_makefiles.cmake +++ b/.gitlab/ci/configure_fedora36_makefiles.cmake @@ -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 "") diff --git a/.gitlab/ci/configure_fedora36_ninja.cmake b/.gitlab/ci/configure_fedora36_ninja.cmake index 7d5105d..45d9192 100644 --- a/.gitlab/ci/configure_fedora36_ninja.cmake +++ b/.gitlab/ci/configure_fedora36_ninja.cmake @@ -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 "") diff --git a/.gitlab/ci/configure_fedora36_ninja_multi.cmake b/.gitlab/ci/configure_fedora36_ninja_multi.cmake index 20863a2..94af721 100644 --- a/.gitlab/ci/configure_fedora36_ninja_multi.cmake +++ b/.gitlab/ci/configure_fedora36_ninja_multi.cmake @@ -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") diff --git a/.gitlab/ci/configure_macos_x86_64_makefiles.cmake b/.gitlab/ci/configure_macos_x86_64_makefiles.cmake index f657d98..d3ef93f 100644 --- a/.gitlab/ci/configure_macos_x86_64_makefiles.cmake +++ b/.gitlab/ci/configure_macos_x86_64_makefiles.cmake @@ -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") diff --git a/.gitlab/ci/configure_macos_x86_64_ninja.cmake b/.gitlab/ci/configure_macos_x86_64_ninja.cmake index f657d98..d3ef93f 100644 --- a/.gitlab/ci/configure_macos_x86_64_ninja.cmake +++ b/.gitlab/ci/configure_macos_x86_64_ninja.cmake @@ -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") diff --git a/.gitlab/ci/configure_windows_vs2022_x64_ninja.cmake b/.gitlab/ci/configure_windows_vs2022_x64_ninja.cmake index c078f90..7f57181 100644 --- a/.gitlab/ci/configure_windows_vs2022_x64_ninja.cmake +++ b/.gitlab/ci/configure_windows_vs2022_x64_ninja.cmake @@ -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") diff --git a/.gitlab/ci/env_fedora36_makefiles.sh b/.gitlab/ci/env_fedora36_makefiles.sh new file mode 100644 index 0000000..217ff30 --- /dev/null +++ b/.gitlab/ci/env_fedora36_makefiles.sh @@ -0,0 +1,3 @@ +if test "$CMAKE_CI_NIGHTLY" = "true"; then + source .gitlab/ci/ispc-env.sh +fi diff --git a/.gitlab/ci/env_fedora36_ninja.sh b/.gitlab/ci/env_fedora36_ninja.sh new file mode 100644 index 0000000..217ff30 --- /dev/null +++ b/.gitlab/ci/env_fedora36_ninja.sh @@ -0,0 +1,3 @@ +if test "$CMAKE_CI_NIGHTLY" = "true"; then + source .gitlab/ci/ispc-env.sh +fi diff --git a/.gitlab/ci/env_fedora36_ninja_multi.sh b/.gitlab/ci/env_fedora36_ninja_multi.sh new file mode 100644 index 0000000..217ff30 --- /dev/null +++ b/.gitlab/ci/env_fedora36_ninja_multi.sh @@ -0,0 +1,3 @@ +if test "$CMAKE_CI_NIGHTLY" = "true"; then + source .gitlab/ci/ispc-env.sh +fi diff --git a/.gitlab/ci/env_macos_x86_64_makefiles.sh b/.gitlab/ci/env_macos_x86_64_makefiles.sh new file mode 100644 index 0000000..217ff30 --- /dev/null +++ b/.gitlab/ci/env_macos_x86_64_makefiles.sh @@ -0,0 +1,3 @@ +if test "$CMAKE_CI_NIGHTLY" = "true"; then + source .gitlab/ci/ispc-env.sh +fi diff --git a/.gitlab/ci/env_macos_x86_64_ninja.sh b/.gitlab/ci/env_macos_x86_64_ninja.sh new file mode 100644 index 0000000..217ff30 --- /dev/null +++ b/.gitlab/ci/env_macos_x86_64_ninja.sh @@ -0,0 +1,3 @@ +if test "$CMAKE_CI_NIGHTLY" = "true"; then + source .gitlab/ci/ispc-env.sh +fi diff --git a/.gitlab/ci/env_windows_vs2022_x64_ninja.ps1 b/.gitlab/ci/env_windows_vs2022_x64_ninja.ps1 new file mode 100755 index 0000000..f8a86c4 --- /dev/null +++ b/.gitlab/ci/env_windows_vs2022_x64_ninja.ps1 @@ -0,0 +1,3 @@ +if ("$env:CMAKE_CI_NIGHTLY" -eq "true") { + Invoke-Expression ".gitlab/ci/ispc-env.ps1" +} diff --git a/.gitlab/ci/ispc-env.ps1 b/.gitlab/ci/ispc-env.ps1 new file mode 100755 index 0000000..1baea31 --- /dev/null +++ b/.gitlab/ci/ispc-env.ps1 @@ -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 diff --git a/.gitlab/ci/ispc-env.sh b/.gitlab/ci/ispc-env.sh new file mode 100644 index 0000000..31a4494 --- /dev/null +++ b/.gitlab/ci/ispc-env.sh @@ -0,0 +1,3 @@ +.gitlab/ci/ispc.sh +export PATH=$PWD/.gitlab/ispc/bin:$PATH +ispc --version diff --git a/.gitlab/ci/ispc.ps1 b/.gitlab/ci/ispc.ps1 new file mode 100755 index 0000000..13267c3 --- /dev/null +++ b/.gitlab/ci/ispc.ps1 @@ -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" diff --git a/.gitlab/ci/ispc.sh b/.gitlab/ci/ispc.sh new file mode 100755 index 0000000..2804277 --- /dev/null +++ b/.gitlab/ci/ispc.sh @@ -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 -- cgit v0.12