From 430aa379d41ee3890957d070a0105468369ab755 Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 5 Apr 2023 10:38:06 -0400 Subject: ci: De-duplicate Windows test script for OpenWatcom job Move job-specific setup to an environment script. --- .gitlab-ci.yml | 2 +- .gitlab/ci/env_windows_openwatcom1.9.ps1 | 1 + .gitlab/ci/openwatcom-env.ps1 | 7 +++++++ .gitlab/os-windows.yml | 16 ---------------- 4 files changed, 9 insertions(+), 17 deletions(-) create mode 100755 .gitlab/ci/env_windows_openwatcom1.9.ps1 create mode 100755 .gitlab/ci/openwatcom-env.ps1 diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2c81b37..2ee4930 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1209,7 +1209,7 @@ t:windows-msvc-v71-nmake: t:windows-openwatcom1.9: extends: - .windows_openwatcom1.9 - - .cmake_test_windows_openwatcom + - .cmake_test_windows_external - .windows_x86_64_tags_concurrent - .cmake_junit_artifacts - .run_dependent diff --git a/.gitlab/ci/env_windows_openwatcom1.9.ps1 b/.gitlab/ci/env_windows_openwatcom1.9.ps1 new file mode 100755 index 0000000..49c28f7 --- /dev/null +++ b/.gitlab/ci/env_windows_openwatcom1.9.ps1 @@ -0,0 +1 @@ +. .gitlab/ci/openwatcom-env.ps1 diff --git a/.gitlab/ci/openwatcom-env.ps1 b/.gitlab/ci/openwatcom-env.ps1 new file mode 100755 index 0000000..14ea523 --- /dev/null +++ b/.gitlab/ci/openwatcom-env.ps1 @@ -0,0 +1,7 @@ +Invoke-Expression -Command .gitlab/ci/openwatcom.ps1 +$pwdpath = $pwd.Path +Set-Item -Force -Path "env:PATH" -Value "$pwdpath\.gitlab\watcom\binnt;$pwdpath\.gitlab\watcom\binw;$env:PATH" +Set-Item -Force -Path "env:INCLUDE" -Value "$pwdpath\.gitlab\watcom\h;$pwdpath\.gitlab\watcom\h\nt" +Set-Item -Force -Path "env:EDPATH" -Value "$pwdpath\.gitlab\watcom\eddat" +Set-Item -Force -Path "env:WATCOM" -Value "$pwdpath\.gitlab\watcom" +Set-Item -Force -Path "env:WLINKTMP" -Value "." diff --git a/.gitlab/os-windows.yml b/.gitlab/os-windows.yml index ded3e65..efce201 100644 --- a/.gitlab/os-windows.yml +++ b/.gitlab/os-windows.yml @@ -431,19 +431,3 @@ - build/install/bin/ctest --output-on-failure -V -S .gitlab/ci/ctest_standalone.cmake interruptible: true - -.cmake_test_windows_openwatcom: - stage: test-ext - - script: - - . .gitlab/ci/env.ps1 - - Invoke-Expression -Command .gitlab/ci/openwatcom.ps1 - - $pwdpath = $pwd.Path - - Set-Item -Force -Path "env:PATH" -Value "$pwdpath\.gitlab\watcom\binnt;$pwdpath\.gitlab\watcom\binw;$env:PATH" - - Set-Item -Force -Path "env:INCLUDE" -Value "$pwdpath\.gitlab\watcom\h;$pwdpath\.gitlab\watcom\h\nt" - - Set-Item -Force -Path "env:EDPATH" -Value "$pwdpath\.gitlab\watcom\eddat" - - Set-Item -Force -Path "env:WATCOM" -Value "$pwdpath\.gitlab\watcom" - - Set-Item -Force -Path "env:WLINKTMP" -Value "." - - build/install/bin/ctest --output-on-failure -V -S .gitlab/ci/ctest_standalone.cmake - - interruptible: true -- cgit v0.12 From 8af9a52d3e9d9965f306099afc288b86db99e748 Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 5 Apr 2023 10:40:16 -0400 Subject: ci: De-duplicate Windows test script for MSVC v71 NMake job Move job-specific setup to an environment script. --- .gitlab-ci.yml | 2 +- .gitlab/ci/env_windows_msvc_v71_nmake.ps1 | 2 ++ .gitlab/os-windows.yml | 11 ----------- 3 files changed, 3 insertions(+), 12 deletions(-) create mode 100755 .gitlab/ci/env_windows_msvc_v71_nmake.ps1 diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2ee4930..5ec100c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1195,7 +1195,7 @@ t:mingw_osdn_io-msys_makefiles: t:windows-msvc-v71-nmake: extends: - .windows_msvc_v71_nmake - - .cmake_test_windows_msvc + - .cmake_test_windows_external - .windows_x86_64_tags_concurrent - .cmake_junit_artifacts - .run_dependent diff --git a/.gitlab/ci/env_windows_msvc_v71_nmake.ps1 b/.gitlab/ci/env_windows_msvc_v71_nmake.ps1 new file mode 100755 index 0000000..cb3806d --- /dev/null +++ b/.gitlab/ci/env_windows_msvc_v71_nmake.ps1 @@ -0,0 +1,2 @@ +Invoke-Expression -Command .gitlab/ci/msvc.ps1 +Invoke-Expression -Command .gitlab/ci/vcvarsall.ps1 diff --git a/.gitlab/os-windows.yml b/.gitlab/os-windows.yml index efce201..34abb29 100644 --- a/.gitlab/os-windows.yml +++ b/.gitlab/os-windows.yml @@ -420,14 +420,3 @@ - build/install/bin/ctest --output-on-failure -V -S .gitlab/ci/ctest_standalone.cmake interruptible: true - -.cmake_test_windows_msvc: - stage: test-ext - - script: - - . .gitlab/ci/env.ps1 - - Invoke-Expression -Command .gitlab/ci/msvc.ps1 - - Invoke-Expression -Command .gitlab/ci/vcvarsall.ps1 - - build/install/bin/ctest --output-on-failure -V -S .gitlab/ci/ctest_standalone.cmake - - interruptible: true -- cgit v0.12 From e2cf20e58c1e5c96c977d647460cdcce92abeb57 Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 5 Apr 2023 10:43:03 -0400 Subject: ci: De-duplicate Windows test script for Borland jobs Move job-specific setup to environment scripts. --- .gitlab-ci.yml | 4 ++-- .gitlab/ci/borland-env.ps1 | 3 +++ .gitlab/ci/env_windows_borland5.5.ps1 | 1 + .gitlab/ci/env_windows_borland5.8.ps1 | 1 + .gitlab/os-windows.yml | 12 ------------ 5 files changed, 7 insertions(+), 14 deletions(-) create mode 100755 .gitlab/ci/borland-env.ps1 create mode 100755 .gitlab/ci/env_windows_borland5.5.ps1 create mode 100755 .gitlab/ci/env_windows_borland5.8.ps1 diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5ec100c..aa3b699 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1079,7 +1079,7 @@ t:windows-vs2022-x64-jom: t:windows-borland5.5: extends: - .windows_borland5.5 - - .cmake_test_windows_borland + - .cmake_test_windows_external - .windows_x86_64_tags_concurrent - .cmake_junit_artifacts - .run_dependent @@ -1093,7 +1093,7 @@ t:windows-borland5.5: t:windows-borland5.8: extends: - .windows_borland5.8 - - .cmake_test_windows_borland + - .cmake_test_windows_external - .windows_x86_64_tags_concurrent - .cmake_junit_artifacts - .run_dependent diff --git a/.gitlab/ci/borland-env.ps1 b/.gitlab/ci/borland-env.ps1 new file mode 100755 index 0000000..b3b532e --- /dev/null +++ b/.gitlab/ci/borland-env.ps1 @@ -0,0 +1,3 @@ +Invoke-Expression -Command .gitlab/ci/borland.ps1 +$pwdpath = $pwd.Path +Set-Item -Force -Path "env:PATH" -Value "$pwdpath\.gitlab\bcc\bin;$env:PATH" diff --git a/.gitlab/ci/env_windows_borland5.5.ps1 b/.gitlab/ci/env_windows_borland5.5.ps1 new file mode 100755 index 0000000..0d2e46b --- /dev/null +++ b/.gitlab/ci/env_windows_borland5.5.ps1 @@ -0,0 +1 @@ +. .gitlab/ci/borland-env.ps1 diff --git a/.gitlab/ci/env_windows_borland5.8.ps1 b/.gitlab/ci/env_windows_borland5.8.ps1 new file mode 100755 index 0000000..0d2e46b --- /dev/null +++ b/.gitlab/ci/env_windows_borland5.8.ps1 @@ -0,0 +1 @@ +. .gitlab/ci/borland-env.ps1 diff --git a/.gitlab/os-windows.yml b/.gitlab/os-windows.yml index 34abb29..b932b74 100644 --- a/.gitlab/os-windows.yml +++ b/.gitlab/os-windows.yml @@ -408,15 +408,3 @@ - build/install/bin/ctest --output-on-failure -V -S .gitlab/ci/ctest_standalone.cmake interruptible: true - -.cmake_test_windows_borland: - stage: test-ext - - script: - - . .gitlab/ci/env.ps1 - - Invoke-Expression -Command .gitlab/ci/borland.ps1 - - $pwdpath = $pwd.Path - - Set-Item -Force -Path "env:PATH" -Value "$pwdpath\.gitlab\bcc\bin;$env:PATH" - - build/install/bin/ctest --output-on-failure -V -S .gitlab/ci/ctest_standalone.cmake - - interruptible: true -- cgit v0.12 From 3f1a1bad76c7ab7f5ebb8757fe2902607d167492 Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 5 Apr 2023 10:44:35 -0400 Subject: ci: De-duplicate Windows test script for JOM job Move job-specific setup to an environment script. --- .gitlab-ci.yml | 2 +- .gitlab/ci/env_windows_vs2022_x64_jom.ps1 | 4 ++++ .gitlab/os-windows.yml | 13 ------------- 3 files changed, 5 insertions(+), 14 deletions(-) create mode 100755 .gitlab/ci/env_windows_vs2022_x64_jom.ps1 diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index aa3b699..fb2bf01 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1065,7 +1065,7 @@ t:windows-vs2022-x64-nmake: t:windows-vs2022-x64-jom: extends: - .windows_vs2022_x64_jom - - .cmake_test_windows_jom + - .cmake_test_windows_external - .windows_x86_64_tags_concurrent_vs2022 - .cmake_junit_artifacts - .run_dependent diff --git a/.gitlab/ci/env_windows_vs2022_x64_jom.ps1 b/.gitlab/ci/env_windows_vs2022_x64_jom.ps1 new file mode 100755 index 0000000..c933421 --- /dev/null +++ b/.gitlab/ci/env_windows_vs2022_x64_jom.ps1 @@ -0,0 +1,4 @@ +Invoke-Expression -Command .gitlab/ci/jom.ps1 +$pwdpath = $pwd.Path +Set-Item -Force -Path "env:PATH" -Value "$pwdpath\.gitlab\jom;$env:PATH" +Invoke-Expression -Command .gitlab/ci/vcvarsall.ps1 diff --git a/.gitlab/os-windows.yml b/.gitlab/os-windows.yml index b932b74..b915d4b 100644 --- a/.gitlab/os-windows.yml +++ b/.gitlab/os-windows.yml @@ -395,16 +395,3 @@ - build/install/bin/ctest --output-on-failure -V -S .gitlab/ci/ctest_standalone.cmake interruptible: true - -.cmake_test_windows_jom: - stage: test-ext - - script: - - . .gitlab/ci/env.ps1 - - Invoke-Expression -Command .gitlab/ci/jom.ps1 - - $pwdpath = $pwd.Path - - Set-Item -Force -Path "env:PATH" -Value "$pwdpath\.gitlab\jom;$env:PATH" - - Invoke-Expression -Command .gitlab/ci/vcvarsall.ps1 - - build/install/bin/ctest --output-on-failure -V -S .gitlab/ci/ctest_standalone.cmake - - interruptible: true -- cgit v0.12 From 3532823dd740ea876e0362f84be9c97405e19205 Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 5 Apr 2023 10:45:44 -0400 Subject: ci: De-duplicate Windows test script for NMake job Move job-specific setup to an environment script. --- .gitlab-ci.yml | 2 +- .gitlab/ci/env_windows_vs2022_x64_nmake.ps1 | 1 + .gitlab/os-windows.yml | 10 ---------- 3 files changed, 2 insertions(+), 11 deletions(-) create mode 100755 .gitlab/ci/env_windows_vs2022_x64_nmake.ps1 diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index fb2bf01..b26172d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1051,7 +1051,7 @@ t:windows-vs2019-x64: t:windows-vs2022-x64-nmake: extends: - .windows_vs2022_x64_nmake - - .cmake_test_windows_nmake + - .cmake_test_windows_external - .windows_x86_64_tags_concurrent_vs2022 - .cmake_junit_artifacts - .run_dependent diff --git a/.gitlab/ci/env_windows_vs2022_x64_nmake.ps1 b/.gitlab/ci/env_windows_vs2022_x64_nmake.ps1 new file mode 100755 index 0000000..62463cd --- /dev/null +++ b/.gitlab/ci/env_windows_vs2022_x64_nmake.ps1 @@ -0,0 +1 @@ +Invoke-Expression -Command .gitlab/ci/vcvarsall.ps1 diff --git a/.gitlab/os-windows.yml b/.gitlab/os-windows.yml index b915d4b..aa817d0 100644 --- a/.gitlab/os-windows.yml +++ b/.gitlab/os-windows.yml @@ -385,13 +385,3 @@ - build/install/bin/ctest --output-on-failure -V -S .gitlab/ci/ctest_standalone.cmake interruptible: true - -.cmake_test_windows_nmake: - stage: test-ext - - script: - - . .gitlab/ci/env.ps1 - - Invoke-Expression -Command .gitlab/ci/vcvarsall.ps1 - - build/install/bin/ctest --output-on-failure -V -S .gitlab/ci/ctest_standalone.cmake - - interruptible: true -- cgit v0.12 From 967456423b8bcc4f833c897140339e62ceb7bcb5 Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 5 Apr 2023 14:25:04 -0400 Subject: ci: Factor out initial setup script for Windows external test jobs On Linux and macOS we use the "before script" for both build and test jobs. On Windows we only want a subset of it, but give it a dedicated helper for consistency. --- .gitlab/os-windows.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitlab/os-windows.yml b/.gitlab/os-windows.yml index aa817d0..c7ee28b 100644 --- a/.gitlab/os-windows.yml +++ b/.gitlab/os-windows.yml @@ -349,6 +349,9 @@ - . .gitlab/ci/qt-env.ps1 - . .gitlab/ci/python-env.ps1 +.before_script_windows_external: &before_script_windows_external + - . .gitlab/ci/env.ps1 + .cmake_build_windows: stage: build @@ -381,7 +384,7 @@ stage: test-ext script: - - . .gitlab/ci/env.ps1 + - *before_script_windows_external - build/install/bin/ctest --output-on-failure -V -S .gitlab/ci/ctest_standalone.cmake interruptible: true -- cgit v0.12 From 99bf8418ee076e81c3ea7b1df333afdf3227967d Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 5 Apr 2023 13:12:36 -0400 Subject: ci: Update to Python 3.11.3 in Windows jobs Use the official embedded distribution `.zip` files, but put copies at URLs we control. --- .gitlab/ci/download_python3.cmake | 41 --------------------------------------- .gitlab/ci/python-env.ps1 | 2 +- .gitlab/ci/python.ps1 | 30 ++++++++++++++++++++++++++++ 3 files changed, 31 insertions(+), 42 deletions(-) delete mode 100644 .gitlab/ci/download_python3.cmake create mode 100755 .gitlab/ci/python.ps1 diff --git a/.gitlab/ci/download_python3.cmake b/.gitlab/ci/download_python3.cmake deleted file mode 100644 index 0f5b18b..0000000 --- a/.gitlab/ci/download_python3.cmake +++ /dev/null @@ -1,41 +0,0 @@ -cmake_minimum_required(VERSION 3.17) - -set(version "3.8.6") -set(sha256sum "376e18eef7e3ea467f0e3af041b01fc7e2f12855506c2ab2653ceb5e0951212e") -set(dirname "python-${version}-embed-win-x86_64") -set(tarball "${dirname}.tar.xz") - -# Download the file. -file(DOWNLOAD - "https://cmake.org/files/dependencies/${tarball}" - ".gitlab/${tarball}" - STATUS download_status - EXPECTED_HASH "SHA256=${sha256sum}") - -# Check the download status. -list(GET download_status 0 res) -if (res) - list(GET download_status 1 err) - message(FATAL_ERROR - "Failed to download ${tarball}: ${err}") -endif () - -# Extract the file. -execute_process( - COMMAND - "${CMAKE_COMMAND}" - -E tar - xzf "${tarball}" - WORKING_DIRECTORY ".gitlab" - RESULT_VARIABLE res - ERROR_VARIABLE err - ERROR_STRIP_TRAILING_WHITESPACE) -if (res) - message(FATAL_ERROR - "Failed to extract ${tarball}: ${err}") -endif () - -# Move to a predictable directory. -file(RENAME - ".gitlab/${dirname}" - ".gitlab/python3") diff --git a/.gitlab/ci/python-env.ps1 b/.gitlab/ci/python-env.ps1 index 4e897d8..ce16493 100755 --- a/.gitlab/ci/python-env.ps1 +++ b/.gitlab/ci/python-env.ps1 @@ -1,4 +1,4 @@ $pwdpath = $pwd.Path -cmake -P .gitlab/ci/download_python3.cmake +& "$pwsh" -File ".gitlab/ci/python.ps1" Set-Item -Force -Path "env:PATH" -Value "$pwdpath\.gitlab\python3;$env:PATH" python --version diff --git a/.gitlab/ci/python.ps1 b/.gitlab/ci/python.ps1 new file mode 100755 index 0000000..27f1807 --- /dev/null +++ b/.gitlab/ci/python.ps1 @@ -0,0 +1,30 @@ +$erroractionpreference = "stop" + +$version = "3.11.3" + +if ("$env:PROCESSOR_ARCHITECTURE" -eq "AMD64") { + $sha256sum = "7419B2E98516FBD0B66A1237B80187FFB21D32E47B4A4235C2D9D6379597070F" + $arch = "amd64" +} elseif ("$env:PROCESSOR_ARCHITECTURE" -eq "ARM64") { + $sha256sum = "03BAD6A7C898FC8F693982437AAB6DB698107B82EA93F76424195AE2C161246C" + $arch = "arm64" +} else { + throw ('unknown PROCESSOR_ARCHITECTURE: ' + "$env:PROCESSOR_ARCHITECTURE") +} + +$filename = "python-$version-embed-$arch" +$tarball = "$filename.zip" + +$outdir = $pwd.Path +$outdir = "$outdir\.gitlab" +$ProgressPreference = 'SilentlyContinue' +Invoke-WebRequest -Uri "https://cmake.org/files/dependencies/internal/$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\python3") +Remove-Item "$outdir\python3\*._pth" # Avoid sys.path specific to embedded python. +Remove-Item "$outdir\$tarball" -- cgit v0.12 From b7400800df8d284eb1707081641fc0c62a82aa5c Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 5 Apr 2023 14:33:59 -0400 Subject: ci: Make python available in all Windows test jobs Activate test infrastructure that requires python. --- .gitlab/os-windows.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab/os-windows.yml b/.gitlab/os-windows.yml index c7ee28b..f1e86ad 100644 --- a/.gitlab/os-windows.yml +++ b/.gitlab/os-windows.yml @@ -351,6 +351,7 @@ .before_script_windows_external: &before_script_windows_external - . .gitlab/ci/env.ps1 + - . .gitlab/ci/python-env.ps1 .cmake_build_windows: stage: build -- cgit v0.12