From ef3495f74f9c35684a2596c1019b08f1787a0376 Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 22 Apr 2024 18:11:11 -0400 Subject: ci: Factor out scripts to add cmake to job environment --- .gitlab/ci/cmake-env.ps1 | 5 +++++ .gitlab/ci/cmake-env.sh | 3 +++ .gitlab/os-linux.yml | 4 +--- .gitlab/os-macos.yml | 4 +--- .gitlab/os-windows.yml | 6 +----- 5 files changed, 11 insertions(+), 11 deletions(-) create mode 100755 .gitlab/ci/cmake-env.ps1 create mode 100644 .gitlab/ci/cmake-env.sh diff --git a/.gitlab/ci/cmake-env.ps1 b/.gitlab/ci/cmake-env.ps1 new file mode 100755 index 0000000..505fa44 --- /dev/null +++ b/.gitlab/ci/cmake-env.ps1 @@ -0,0 +1,5 @@ +$pwdpath = $pwd.Path +& "$pwsh" -File ".gitlab/ci/cmake.ps1" +Set-Item -Force -Path "env:PATH" -Value "$pwdpath\.gitlab\cmake\bin;$env:PATH" +cmake --version +$cmake = "cmake" diff --git a/.gitlab/ci/cmake-env.sh b/.gitlab/ci/cmake-env.sh new file mode 100644 index 0000000..686a78f --- /dev/null +++ b/.gitlab/ci/cmake-env.sh @@ -0,0 +1,3 @@ +.gitlab/ci/cmake.sh +export PATH="$PWD/.gitlab/cmake/bin:$PATH" +cmake --version diff --git a/.gitlab/os-linux.yml b/.gitlab/os-linux.yml index dc32016..11b4780 100644 --- a/.gitlab/os-linux.yml +++ b/.gitlab/os-linux.yml @@ -511,11 +511,9 @@ .before_script_linux: &before_script_linux - source .gitlab/ci/env.sh - - .gitlab/ci/cmake.sh - - export PATH=$PWD/.gitlab/cmake/bin:$PATH + - source .gitlab/ci/cmake-env.sh - .gitlab/ci/ninja.sh - export PATH=$PWD/.gitlab:$PATH - - cmake --version - ninja --version .cmake_prep_source_linux: diff --git a/.gitlab/os-macos.yml b/.gitlab/os-macos.yml index 23c68d5..5d148e0 100644 --- a/.gitlab/os-macos.yml +++ b/.gitlab/os-macos.yml @@ -175,11 +175,9 @@ .before_script_macos: &before_script_macos - source .gitlab/ci/env.sh - - .gitlab/ci/cmake.sh - - export PATH=$PWD/.gitlab/cmake/bin:$PATH + - source .gitlab/ci/cmake-env.sh - .gitlab/ci/ninja.sh - export PATH=$PWD/.gitlab:$PATH - - cmake --version - ninja --version # Download Qt - cmake -P .gitlab/ci/download_qt.cmake diff --git a/.gitlab/os-windows.yml b/.gitlab/os-windows.yml index 3cd6e56..a0e22bf 100644 --- a/.gitlab/os-windows.yml +++ b/.gitlab/os-windows.yml @@ -386,12 +386,8 @@ .before_script_windows: &before_script_windows - . .gitlab/ci/env.ps1 - - $pwdpath = $pwd.Path - - (& "$pwsh" -File ".gitlab/ci/cmake.ps1") - - Set-Item -Force -Path "env:PATH" -Value "$pwdpath\.gitlab\cmake\bin;$env:PATH" - - $cmake = "cmake" + - . .gitlab/ci/cmake-env.ps1 - . .gitlab/ci/ninja-env.ps1 - - cmake --version - . .gitlab/ci/qt-env.ps1 - . .gitlab/ci/python-env.ps1 -- cgit v0.12