From 05531a7c4e499847b7d174fb7697e840c223bc98 Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 28 Feb 2023 09:59:39 -0500 Subject: gitlab-ci: add pre-build and post-build steps to Windows Apply the approach from commit 372ce5bffe (ci: add pre-build and post-build steps to Linux, 2022-12-05, v3.26.0-rc1~225^2~1) to build jobs on Windows. --- .gitlab/ci/post_build.ps1 | 4 ++++ .gitlab/ci/pre_build.ps1 | 4 ++++ .gitlab/os-windows.yml | 2 ++ 3 files changed, 10 insertions(+) create mode 100755 .gitlab/ci/post_build.ps1 create mode 100755 .gitlab/ci/pre_build.ps1 diff --git a/.gitlab/ci/post_build.ps1 b/.gitlab/ci/post_build.ps1 new file mode 100755 index 0000000..fbd8ae8 --- /dev/null +++ b/.gitlab/ci/post_build.ps1 @@ -0,0 +1,4 @@ +$pwsh = [System.Diagnostics.Process]::GetCurrentProcess().MainModule.FileName +if (Test-Path -Path ".gitlab/ci/post_build_$env:CMAKE_CONFIGURATION.ps1" -PathType Leaf) { + . ".gitlab/ci/post_build_$env:CMAKE_CONFIGURATION.ps1" +} diff --git a/.gitlab/ci/pre_build.ps1 b/.gitlab/ci/pre_build.ps1 new file mode 100755 index 0000000..3a56687 --- /dev/null +++ b/.gitlab/ci/pre_build.ps1 @@ -0,0 +1,4 @@ +$pwsh = [System.Diagnostics.Process]::GetCurrentProcess().MainModule.FileName +if (Test-Path -Path ".gitlab/ci/pre_build_$env:CMAKE_CONFIGURATION.ps1" -PathType Leaf) { + . ".gitlab/ci/pre_build_$env:CMAKE_CONFIGURATION.ps1" +} diff --git a/.gitlab/os-windows.yml b/.gitlab/os-windows.yml index 24db802..ca5af43 100644 --- a/.gitlab/os-windows.yml +++ b/.gitlab/os-windows.yml @@ -358,8 +358,10 @@ - Invoke-Expression -Command .gitlab/ci/vcvarsall.ps1 - sccache --start-server - sccache --show-stats + - (& "$pwsh" -File ".gitlab/ci/pre_build.ps1") - ctest -VV -S .gitlab/ci/ctest_configure.cmake - ctest -VV -S .gitlab/ci/ctest_build.cmake + - (& "$pwsh" -File ".gitlab/ci/post_build.ps1") - sccache --show-stats - sccache --stop-server -- cgit v0.12