Unverified Commit 2ce2b096 authored by James Lamb's avatar James Lamb Committed by GitHub
Browse files

[ci] stop testing on Windows Server 2019 (#6953)

* [ci] stop testing on Windows Server 2019

* update Visual Studio version

* add support for newer MSVC versions

* temporarily skip integrated OpenCL on Windows
parent 195c26fc
...@@ -110,7 +110,8 @@ if ($env:TASK -eq "regular") { ...@@ -110,7 +110,8 @@ if ($env:TASK -eq "regular") {
Get-ItemProperty -Path Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Khronos\OpenCL\Vendors Get-ItemProperty -Path Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Khronos\OpenCL\Vendors
conda activate $env:CONDA_ENV conda activate $env:CONDA_ENV
sh "build-python.sh" bdist_wheel --integrated-opencl ; Assert-Output $? # TODO: restore --integrated-opencl as part of https://github.com/microsoft/LightGBM/issues/6968
sh "build-python.sh" bdist_wheel ; Assert-Output $?
sh ./.ci/check-python-dists.sh ./dist ; Assert-Output $? sh ./.ci/check-python-dists.sh ./dist ; Assert-Output $?
Set-Location dist; pip install @(Get-ChildItem *py3-none-win_amd64.whl) ; Assert-Output $? Set-Location dist; pip install @(Get-ChildItem *py3-none-win_amd64.whl) ; Assert-Output $?
cp @(Get-ChildItem *py3-none-win_amd64.whl) "$env:BUILD_ARTIFACTSTAGINGDIRECTORY" cp @(Get-ChildItem *py3-none-win_amd64.whl) "$env:BUILD_ARTIFACTSTAGINGDIRECTORY"
...@@ -130,7 +131,8 @@ if (($env:TASK -eq "sdist") -or (($env:APPVEYOR -eq "true") -and ($env:TASK -eq ...@@ -130,7 +131,8 @@ if (($env:TASK -eq "sdist") -or (($env:APPVEYOR -eq "true") -and ($env:TASK -eq
} }
if ($env:TASK -eq "bdist") { if ($env:TASK -eq "bdist") {
# Make sure we can do both CPU and GPU; see tests/python_package_test/test_dual.py # Make sure we can do both CPU and GPU; see tests/python_package_test/test_dual.py
$env:LIGHTGBM_TEST_DUAL_CPU_GPU = "1" # TODO: set LIGHTGBM_TEST_DUAL_CPU_GPU back to "1" as part of https://github.com/microsoft/LightGBM/issues/6968
env:LIGHTGBM_TEST_DUAL_CPU_GPU = "0"
} }
pytest $tests ; Assert-Output $? pytest $tests ; Assert-Output $?
......
...@@ -97,15 +97,14 @@ jobs: ...@@ -97,15 +97,14 @@ jobs:
r_version: 4.3 r_version: 4.3
build_type: cmake build_type: cmake
container: null container: null
# Visual Studio 2019 # Visual Studio 2022
- os: windows-2019 - os: windows-2022
task: r-package task: r-package
compiler: MSVC compiler: MSVC
toolchain: MSVC toolchain: MSVC
r_version: 3.6 r_version: 3.6
build_type: cmake build_type: cmake
container: null container: null
# Visual Studio 2022
- os: windows-2022 - os: windows-2022
task: r-package task: r-package
compiler: MSVC compiler: MSVC
......
...@@ -286,7 +286,7 @@ jobs: ...@@ -286,7 +286,7 @@ jobs:
########### ###########
- job: Windows - job: Windows
pool: pool:
vmImage: 'windows-2019' vmImage: 'windows-2022'
strategy: strategy:
matrix: matrix:
regular: regular:
......
...@@ -66,8 +66,14 @@ set(BOOST_INCLUDE "${BOOST_BASE}/source" CACHE PATH "") ...@@ -66,8 +66,14 @@ set(BOOST_INCLUDE "${BOOST_BASE}/source" CACHE PATH "")
set(BOOST_LIBRARY "${BOOST_BASE}/source/stage/lib" CACHE PATH "") set(BOOST_LIBRARY "${BOOST_BASE}/source/stage/lib" CACHE PATH "")
if(WIN32) if(WIN32)
if(MSVC) if(MSVC)
# references:
#
# * range of MSVC versions: https://learn.microsoft.com/en-us/cpp/overview/compiler-versions
# * MSVC toolchain IDs: not sure...
# comments like https://learn.microsoft.com/en-us/answers/questions/769911/visual-studio-2019-build-tools-v143
#
if(${MSVC_VERSION} GREATER 1929) if(${MSVC_VERSION} GREATER 1929)
message(FATAL_ERROR "Unrecognized MSVC version number: ${MSVC_VERSION}") set(MSVC_TOOLCHAIN_ID "143")
elseif(${MSVC_VERSION} GREATER 1919) elseif(${MSVC_VERSION} GREATER 1919)
set(MSVC_TOOLCHAIN_ID "142") set(MSVC_TOOLCHAIN_ID "142")
elseif(${MSVC_VERSION} GREATER 1909) elseif(${MSVC_VERSION} GREATER 1909)
...@@ -75,7 +81,7 @@ if(WIN32) ...@@ -75,7 +81,7 @@ if(WIN32)
elseif(${MSVC_VERSION} GREATER 1899) elseif(${MSVC_VERSION} GREATER 1899)
set(MSVC_TOOLCHAIN_ID "140") set(MSVC_TOOLCHAIN_ID "140")
else() else()
message(FATAL_ERROR "Unrecognized MSVC version number: ${MSVC_VERSION}") message(FATAL_ERROR "Unsupported MSVC version number: ${MSVC_VERSION}")
endif() endif()
list( list(
APPEND APPEND
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment