summaryrefslogtreecommitdiffstats
path: root/.gitlab/ci
diff options
context:
space:
mode:
Diffstat (limited to '.gitlab/ci')
-rwxr-xr-x.gitlab/ci/cmake.ps118
-rwxr-xr-x.gitlab/ci/cmake.sh30
-rw-r--r--.gitlab/ci/configure_common.cmake10
-rw-r--r--.gitlab/ci/configure_fedora31_makefiles.cmake1
-rw-r--r--.gitlab/ci/configure_fedora31_ninja.cmake1
-rw-r--r--.gitlab/ci/configure_macos_makefiles.cmake1
-rw-r--r--.gitlab/ci/configure_macos_ninja.cmake1
-rw-r--r--.gitlab/ci/configure_windows_vs2019_x64_ninja.cmake3
-rw-r--r--.gitlab/ci/ctest_build.cmake11
-rw-r--r--.gitlab/ci/ctest_exclusions.cmake1
-rwxr-xr-x.gitlab/ci/docker/fedora31/install_deps.sh8
-rwxr-xr-x.gitlab/ci/ninja.ps117
-rwxr-xr-x.gitlab/ci/ninja.sh26
-rwxr-xr-x.gitlab/ci/sccache.ps122
-rwxr-xr-x.gitlab/ci/sccache.sh28
-rwxr-xr-x.gitlab/ci/vcvarsall.ps19
16 files changed, 176 insertions, 11 deletions
diff --git a/.gitlab/ci/cmake.ps1 b/.gitlab/ci/cmake.ps1
new file mode 100755
index 0000000..3b42cae
--- /dev/null
+++ b/.gitlab/ci/cmake.ps1
@@ -0,0 +1,18 @@
+$erroractionpreference = "stop"
+
+$version = "3.17.2"
+$sha256sum = "CF82B1EB20B6FBE583487656FCD496490FFCCDFBCBBA0F26E19F1C9C63B0B041"
+$filename = "cmake-$version-win64-x64"
+$tarball = "$filename.zip"
+
+$outdir = $pwd.Path
+$outdir = "$outdir\.gitlab"
+Invoke-WebRequest -Uri "https://github.com/Kitware/CMake/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\cmake"
diff --git a/.gitlab/ci/cmake.sh b/.gitlab/ci/cmake.sh
index 4b2f53f..658a62a 100755
--- a/.gitlab/ci/cmake.sh
+++ b/.gitlab/ci/cmake.sh
@@ -3,14 +3,38 @@
set -e
readonly version="3.17.2"
-readonly sha256sum="dc57f3cc448ca67fc8776b4ad4c22b087b9c6a8e459938b9622b8c7f4ef6b21e"
-readonly filename="cmake-$version-Linux-x86_64"
+
+case "$( uname -s )" in
+ Linux)
+ shatool="sha256sum"
+ sha256sum="dc57f3cc448ca67fc8776b4ad4c22b087b9c6a8e459938b9622b8c7f4ef6b21e"
+ platform="Linux"
+ ;;
+ Darwin)
+ shatool="shasum -a 256"
+ sha256sum="139500e20b080444fcafe57f24f57248c691c5187cce6695bee2b9aad6792c7d"
+ platform="Darwin"
+ ;;
+ *)
+ echo "Unrecognized platform $( uname -s )"
+ exit 1
+ ;;
+esac
+readonly shatool
+readonly sha256sum
+readonly platform
+
+readonly filename="cmake-$version-$platform-x86_64"
readonly tarball="$filename.tar.gz"
cd .gitlab
echo "$sha256sum $tarball" > cmake.sha256sum
curl -OL "https://github.com/Kitware/CMake/releases/download/v$version/$tarball"
-sha256sum --check cmake.sha256sum
+$shatool --check cmake.sha256sum
tar xf "$tarball"
mv "$filename" cmake
+
+if [ "$( uname -s )" = "Darwin" ]; then
+ ln -s CMake.app/Contents/bin cmake/bin
+fi
diff --git a/.gitlab/ci/configure_common.cmake b/.gitlab/ci/configure_common.cmake
index fc2aaae..4585224 100644
--- a/.gitlab/ci/configure_common.cmake
+++ b/.gitlab/ci/configure_common.cmake
@@ -1,3 +1,13 @@
set(CTEST_USE_LAUNCHERS "ON" CACHE STRING "")
+# We run the install right after the build. Avoid rerunning it when installing.
+set(CMAKE_SKIP_INSTALL_ALL_DEPENDENCY "ON" CACHE STRING "")
+# Install CMake under the build tree.
+set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/install" CACHE PATH "")
+set(CMake_TEST_INSTALL "OFF" CACHE BOOL "")
+
+if (NOT "$ENV{CMAKE_BUILD_TYPE}" STREQUAL "")
+ set(CMAKE_BUILD_TYPE "$ENV{CMAKE_BUILD_TYPE}" CACHE STRING "")
+endif ()
+
include("${CMAKE_CURRENT_LIST_DIR}/configure_sccache.cmake")
diff --git a/.gitlab/ci/configure_fedora31_makefiles.cmake b/.gitlab/ci/configure_fedora31_makefiles.cmake
new file mode 100644
index 0000000..33f0db0
--- /dev/null
+++ b/.gitlab/ci/configure_fedora31_makefiles.cmake
@@ -0,0 +1 @@
+include("${CMAKE_CURRENT_LIST_DIR}/configure_common.cmake")
diff --git a/.gitlab/ci/configure_fedora31_ninja.cmake b/.gitlab/ci/configure_fedora31_ninja.cmake
new file mode 100644
index 0000000..33f0db0
--- /dev/null
+++ b/.gitlab/ci/configure_fedora31_ninja.cmake
@@ -0,0 +1 @@
+include("${CMAKE_CURRENT_LIST_DIR}/configure_common.cmake")
diff --git a/.gitlab/ci/configure_macos_makefiles.cmake b/.gitlab/ci/configure_macos_makefiles.cmake
new file mode 100644
index 0000000..33f0db0
--- /dev/null
+++ b/.gitlab/ci/configure_macos_makefiles.cmake
@@ -0,0 +1 @@
+include("${CMAKE_CURRENT_LIST_DIR}/configure_common.cmake")
diff --git a/.gitlab/ci/configure_macos_ninja.cmake b/.gitlab/ci/configure_macos_ninja.cmake
new file mode 100644
index 0000000..33f0db0
--- /dev/null
+++ b/.gitlab/ci/configure_macos_ninja.cmake
@@ -0,0 +1 @@
+include("${CMAKE_CURRENT_LIST_DIR}/configure_common.cmake")
diff --git a/.gitlab/ci/configure_windows_vs2019_x64_ninja.cmake b/.gitlab/ci/configure_windows_vs2019_x64_ninja.cmake
new file mode 100644
index 0000000..e2f00dd
--- /dev/null
+++ b/.gitlab/ci/configure_windows_vs2019_x64_ninja.cmake
@@ -0,0 +1,3 @@
+set(CMake_TEST_WIX_NO_VERIFY "ON" CACHE BOOL "")
+
+include("${CMAKE_CURRENT_LIST_DIR}/configure_common.cmake")
diff --git a/.gitlab/ci/ctest_build.cmake b/.gitlab/ci/ctest_build.cmake
index 28bdb35..6402a5d 100644
--- a/.gitlab/ci/ctest_build.cmake
+++ b/.gitlab/ci/ctest_build.cmake
@@ -28,3 +28,14 @@ if ("$ENV{CTEST_NO_WARNINGS_ALLOWED}" AND num_warnings GREATER 0)
message(FATAL_ERROR
"Found ${num_warnings} warnings (treating as fatal).")
endif ()
+
+if (NOT "$ENV{CMake_SKIP_INSTALL}")
+ ctest_build(APPEND
+ TARGET install
+ RETURN_VALUE install_result)
+
+ if (install_result)
+ message(FATAL_ERROR
+ "Failed to install")
+ endif ()
+endif ()
diff --git a/.gitlab/ci/ctest_exclusions.cmake b/.gitlab/ci/ctest_exclusions.cmake
index 5bb03ca..d8980f6 100644
--- a/.gitlab/ci/ctest_exclusions.cmake
+++ b/.gitlab/ci/ctest_exclusions.cmake
@@ -1,5 +1,6 @@
set(test_exclusions
)
+
string(REPLACE ";" "|" test_exclusions "${test_exclusions}")
if (test_exclusions)
set(test_exclusions "(${test_exclusions})")
diff --git a/.gitlab/ci/docker/fedora31/install_deps.sh b/.gitlab/ci/docker/fedora31/install_deps.sh
index 7f8da57..bcb1564 100755
--- a/.gitlab/ci/docker/fedora31/install_deps.sh
+++ b/.gitlab/ci/docker/fedora31/install_deps.sh
@@ -8,7 +8,8 @@ dnf install -y \
dnf install --setopt=install_weak_deps=False -y \
clang-tools-extra \
gcc-c++ \
- git-core
+ git-core \
+ make
# Install documentation tools.
dnf install --setopt=install_weak_deps=False -y \
@@ -16,4 +17,9 @@ dnf install --setopt=install_weak_deps=False -y \
texinfo \
qt5-qttools-devel
+# Tools needed for the test suite.
+dnf install --setopt=install_weak_deps=False -y \
+ findutils \
+ file
+
dnf clean all
diff --git a/.gitlab/ci/ninja.ps1 b/.gitlab/ci/ninja.ps1
new file mode 100755
index 0000000..91f8b02
--- /dev/null
+++ b/.gitlab/ci/ninja.ps1
@@ -0,0 +1,17 @@
+$erroractionpreference = "stop"
+
+$version = "1.10.0"
+$sha256sum = "919FD158C16BF135E8A850BB4046EC1CE28A7439EE08B977CD0B7F6B3463D178"
+$filename = "ninja-win"
+$tarball = "$filename.zip"
+
+$outdir = $pwd.Path
+$outdir = "$outdir\.gitlab"
+Invoke-WebRequest -Uri "https://github.com/ninja-build/ninja/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")
diff --git a/.gitlab/ci/ninja.sh b/.gitlab/ci/ninja.sh
index 31da12b..93c1ee9 100755
--- a/.gitlab/ci/ninja.sh
+++ b/.gitlab/ci/ninja.sh
@@ -3,13 +3,33 @@
set -e
readonly version="1.10.0"
-readonly sha256sum="6566836ddf3d72ca06685b34814e0c6fa0f0943542d651d0dab3150f10307c82"
-readonly filename="ninja-linux"
+
+case "$( uname -s )" in
+ Linux)
+ shatool="sha256sum"
+ sha256sum="6566836ddf3d72ca06685b34814e0c6fa0f0943542d651d0dab3150f10307c82"
+ platform="linux"
+ ;;
+ Darwin)
+ shatool="shasum -a 256"
+ sha256sum="2ee405c0e205d55666c60cc9c0d8d04c8ede06d3ef2e2c2aabe08fd81c17d22e"
+ platform="mac"
+ ;;
+ *)
+ echo "Unrecognized platform $( uname -s )"
+ exit 1
+ ;;
+esac
+readonly shatool
+readonly sha256sum
+readonly platform
+
+readonly filename="ninja-$platform"
readonly tarball="$filename.zip"
cd .gitlab
echo "$sha256sum $tarball" > ninja.sha256sum
curl -OL "https://github.com/ninja-build/ninja/releases/download/v$version/$tarball"
-sha256sum --check ninja.sha256sum
+$shatool --check ninja.sha256sum
./cmake/bin/cmake -E tar xf "$tarball"
diff --git a/.gitlab/ci/sccache.ps1 b/.gitlab/ci/sccache.ps1
new file mode 100755
index 0000000..6231c72
--- /dev/null
+++ b/.gitlab/ci/sccache.ps1
@@ -0,0 +1,22 @@
+$erroractionpreference = "stop"
+
+# 0.2.13 is unavailable right now.
+# https://github.com/mozilla/sccache/issues/677
+$version = "0.2.12"
+$sha256sum = "FD05E91C59B9497D4EBAE311B47A982F2A6EB942DCA3C9C314CC1FB36F8BC64D"
+$filename = "sccache-$version-x86_64-pc-windows-msvc"
+$tarball = "$filename.tar.gz"
+
+$outdir = $pwd.Path
+$outdir = "$outdir\.gitlab"
+Invoke-WebRequest -Uri "https://github.com/mozilla/sccache/releases/download/$version/$tarball" -OutFile "$outdir\$tarball"
+$hash = Get-FileHash "$outdir\$tarball" -Algorithm SHA256
+if ($hash.Hash -ne $sha256sum) {
+ exit 1
+}
+
+$curdir = $pwd.Path
+Set-Location -Path "$outdir"
+cmake -E tar xzf "$outdir\$tarball"
+Move-Item -Path "$outdir\$filename\sccache.exe" -Destination "$outdir\sccache.exe"
+Set-Location -Path "$curdir"
diff --git a/.gitlab/ci/sccache.sh b/.gitlab/ci/sccache.sh
index c88cdcc..f7d51ff 100755
--- a/.gitlab/ci/sccache.sh
+++ b/.gitlab/ci/sccache.sh
@@ -2,15 +2,35 @@
set -e
-readonly version="0.2.12"
-readonly sha256sum="26fd04c1273952cc2a0f359a71c8a1857137f0ee3634058b3f4a63b69fc8eb7f"
-readonly filename="sccache-$version-x86_64-unknown-linux-musl"
+readonly version="0.2.13"
+
+case "$( uname -s )" in
+ Linux)
+ shatool="sha256sum"
+ sha256sum="28a5499e340865b08b632306b435913beb590fbd7b49a3f887a623b459fabdeb"
+ platform="x86_64-unknown-linux-musl"
+ ;;
+ Darwin)
+ shatool="shasum -a 256"
+ sha256sum="f564e948abadfc9e409eb1cd7babf24c6784057d5506c3b0a04cdd37cd830ae9"
+ platform="x86_64-apple-darwin"
+ ;;
+ *)
+ echo "Unrecognized platform $( uname -s )"
+ exit 1
+ ;;
+esac
+readonly shatool
+readonly sha256sum
+readonly platform
+
+readonly filename="sccache-$version-$platform"
readonly tarball="$filename.tar.gz"
cd .gitlab
echo "$sha256sum $tarball" > sccache.sha256sum
curl -OL "https://github.com/mozilla/sccache/releases/download/$version/$tarball"
-sha256sum --check sccache.sha256sum
+$shatool --check sccache.sha256sum
tar xf "$tarball"
mv "$filename/sccache" .
diff --git a/.gitlab/ci/vcvarsall.ps1 b/.gitlab/ci/vcvarsall.ps1
new file mode 100755
index 0000000..a48b511
--- /dev/null
+++ b/.gitlab/ci/vcvarsall.ps1
@@ -0,0 +1,9 @@
+$erroractionpreference = "stop"
+
+cmd /c "`"$env:VCVARSALL`" $VCVARSPLATFORM & set" |
+foreach {
+ if ($_ -match "=") {
+ $v = $_.split("=")
+ [Environment]::SetEnvironmentVariable($v[0], $v[1])
+ }
+}