diff --git a/.github/actions/locate-visual-studio/action.yml b/.github/actions/locate-visual-studio/action.yml new file mode 100644 index 000000000000..8d86e4d6bf77 --- /dev/null +++ b/.github/actions/locate-visual-studio/action.yml @@ -0,0 +1,32 @@ +name: 'Locate Visual Studio' +description: 'Resolve the Visual Studio install path at runtime via vswhere. Exports it as the VC_PATH environment variable (and a `path` output) for later steps.' + +outputs: + path: + description: 'Absolute path to the latest Visual Studio installation.' + value: ${{ steps.locate.outputs.path }} + +runs: + using: 'composite' + steps: + - name: Locate Visual Studio + id: locate + # Resolve the VS install path at runtime via vswhere instead of + # hardcoding an edition/year that may not exist on a given runner image. + # vswhere ships with the VS Installer at a fixed location. The result is + # exported as VC_PATH (env) and a `path` output for later steps. + shell: pwsh + run: | + $vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" + if (-not (Test-Path $vswhere)) { + Write-Error "vswhere.exe not found at $vswhere" + exit 1 + } + $vcPath = & $vswhere -latest -products * -property installationPath + if (-not $vcPath) { + Write-Error "Visual Studio installation not found via vswhere" + exit 1 + } + Write-Host "Found Visual Studio at: $vcPath" + "VC_PATH=$vcPath" | Out-File -FilePath $env:GITHUB_ENV -Append + "path=$vcPath" | Out-File -FilePath $env:GITHUB_OUTPUT -Append diff --git a/.github/workflows/build-test-distribute.yml b/.github/workflows/build-test-distribute.yml index a03f1077b32a..4317720ac32f 100644 --- a/.github/workflows/build-test-distribute.yml +++ b/.github/workflows/build-test-distribute.yml @@ -155,7 +155,7 @@ jobs: - linux-vcpkg-build-test - macos-build-test timeout-minutes: 20 - runs-on: windows-2022 + runs-on: windows-2025 steps: - name: Checkout uses: actions/checkout@v6 diff --git a/.github/workflows/build-test-windows.yml b/.github/workflows/build-test-windows.yml index 4498d05586fe..28e4d614bc1c 100644 --- a/.github/workflows/build-test-windows.yml +++ b/.github/workflows/build-test-windows.yml @@ -65,23 +65,7 @@ jobs: uses: actions/checkout@v6 - name: Locate Visual Studio - # Resolve the VS install path at runtime via vswhere instead of - # hardcoding it in the matrix. vswhere ships with the VS Installer at a - # fixed location. The result is exported as VC_PATH for later steps. - shell: pwsh - run: | - $vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" - if (-not (Test-Path $vswhere)) { - Write-Error "vswhere.exe not found at $vswhere" - exit 1 - } - $vcPath = & $vswhere -latest -products * -property installationPath - if (-not $vcPath) { - Write-Error "Visual Studio installation not found via vswhere" - exit 1 - } - Write-Host "Found Visual Studio at: $vcPath" - "VC_PATH=$vcPath" | Out-File -FilePath $env:GITHUB_ENV -Append + uses: ./.github/actions/locate-visual-studio - name: Checkout third-party submodules shell: bash diff --git a/.github/workflows/matrix/windows-full-config.json b/.github/workflows/matrix/windows-full-config.json index 740384f4c64e..30ddf773b6e1 100644 --- a/.github/workflows/matrix/windows-full-config.json +++ b/.github/workflows/matrix/windows-full-config.json @@ -5,28 +5,28 @@ "config": "Debug", "build_system": "MSBuild", "vcpkg_triplet": "x64-windows-vs2022-meshlib", - "runner": ["windows-2022"] + "runner": ["windows-2025"] }, { "cxx_compiler": "msvc-2022", "config": "Release", "build_system": "MSBuild", "vcpkg_triplet": "x64-windows-vs2022-meshlib", - "runner": ["windows-2022"] + "runner": ["windows-2025"] }, { "cxx_compiler": "msvc-2022", "config": "Debug", "build_system": "CMake", "vcpkg_triplet": "x64-windows-vs2022-meshlib", - "runner": ["windows-2022"] + "runner": ["windows-2025"] }, { "cxx_compiler": "msvc-2022", "config": "Release", "build_system": "CMake", "vcpkg_triplet": "x64-windows-vs2022-meshlib", - "runner": ["windows-2022"] + "runner": ["windows-2025"] }, { "cxx_compiler": "msvc-2019", diff --git a/.github/workflows/matrix/windows-minimal-config.json b/.github/workflows/matrix/windows-minimal-config.json index fd7aae5f8777..15edeca49f03 100644 --- a/.github/workflows/matrix/windows-minimal-config.json +++ b/.github/workflows/matrix/windows-minimal-config.json @@ -12,14 +12,14 @@ "config": "Debug", "build_system": "MSBuild", "vcpkg_triplet": "x64-windows-vs2022-meshlib", - "runner": ["windows-2022"] + "runner": ["windows-2025"] }, { "cxx_compiler": "msvc-2022", "config": "Release", "build_system": "CMake", "vcpkg_triplet": "x64-windows-vs2022-meshlib", - "runner": ["windows-2022"] + "runner": ["windows-2025"] }, { "cxx_compiler": "msvc-2019", diff --git a/.github/workflows/matrix/windows-standard-config.json b/.github/workflows/matrix/windows-standard-config.json index 9b647c4a7804..ccbde557fbad 100644 --- a/.github/workflows/matrix/windows-standard-config.json +++ b/.github/workflows/matrix/windows-standard-config.json @@ -19,14 +19,14 @@ "config": "Release", "build_system": "MSBuild", "vcpkg_triplet": "x64-windows-vs2022-meshlib", - "runner": ["windows-2022"] + "runner": ["windows-2025"] }, { "cxx_compiler": "msvc-2022", "config": "Release", "build_system": "CMake", "vcpkg_triplet": "x64-windows-vs2022-meshlib", - "runner": ["windows-2022"] + "runner": ["windows-2025"] }, { "cxx_compiler": "msvc-2019", diff --git a/.github/workflows/pip-build.yml b/.github/workflows/pip-build.yml index 0685f3696cc2..8d2c4bb74de8 100644 --- a/.github/workflows/pip-build.yml +++ b/.github/workflows/pip-build.yml @@ -356,12 +356,16 @@ jobs: needs: setup if: ${{ inputs.disable_windows != true }} timeout-minutes: 90 - runs-on: [windows-2022] + runs-on: [windows-2025] strategy: fail-fast: false permissions: id-token: write # This is required for requesting the JWT contents: read # This is required for actions/checkout + env: + VCPKG_DEFAULT_TRIPLET: x64-windows-vs2022-meshlib + VCVARS_VER: '14.4' + PLATFORM_TOOLSET: v143 steps: - name: Checkout uses: actions/checkout@v6 @@ -369,10 +373,14 @@ jobs: submodules: recursive ref: ${{needs.setup.outputs.version_tag}} + - name: Locate Visual Studio + uses: ./.github/actions/locate-visual-studio + - name: Set up vcpkg uses: ./.github/actions/setup-vcpkg-windows with: vcpkg-version: ${{ env.VCPKG-VERSION }} + vcpkg-triplet: ${{ env.VCPKG_DEFAULT_TRIPLET }} install-flags: '--write-s3' internal-build: 'true' @@ -397,13 +405,13 @@ jobs: run: | $x = (dir $env:CUDA_PATH -dir -recurse -depth 2).where({$_.name -eq 'visual_studio_integration'}).fullname $y = (dir $x -dir -recurse).where({$_.name -eq 'MSBuildExtensions'}).fullname + '\*' - (gi 'C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\VC\*\BuildCustomizations').fullname.foreach({cp $y $_}) + (gi '${{ env.VC_PATH }}\MSBuild\Microsoft\VC\*\BuildCustomizations').fullname.foreach({cp $y $_}) - name: Add msbuild to PATH uses: microsoft/setup-msbuild@30375c66a4eea26614e0d39710365f22f8b0af57 # v3.0.0 - name: Build - run: msbuild -m source\MeshLib.sln -p:Configuration=Release + run: msbuild -m source\MeshLib.sln -p:Configuration=Release -p:VcpkgTriplet=${{ env.VCPKG_DEFAULT_TRIPLET }} -p:PlatformToolset=${{ env.PLATFORM_TOOLSET }} - name: Install MSYS2 for MRBind uses: ./.github/actions/install-msys2-mrbind @@ -420,7 +428,7 @@ jobs: env: MSYS2_DIR: C:\msys64 run: | - call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat" -arch=amd64 + call "${{ env.VC_PATH }}\Common7\Tools\VsDevCmd.bat" -arch=amd64 -vcvars_ver=${{ env.VCVARS_VER }} call ./scripts/mrbind/generate_win.bat -B --trace FOR_WHEEL=1 - name: Run Test @@ -628,7 +636,11 @@ jobs: needs: [windows-pip-build] if: ${{ inputs.disable_windows != true }} timeout-minutes: 90 - runs-on: windows-latest + runs-on: ${{ matrix.runner }} + strategy: + fail-fast: false + matrix: + runner: [windows-2022, windows-2025] steps: - name: Checkout uses: actions/checkout@v6 diff --git a/.github/workflows/test-distribution.yml b/.github/workflows/test-distribution.yml index 87f6d843ba82..7391d9d50ff3 100644 --- a/.github/workflows/test-distribution.yml +++ b/.github/workflows/test-distribution.yml @@ -313,7 +313,7 @@ jobs: windows-test: if: ${{ inputs.test_windows }} - runs-on: windows-2022 + runs-on: windows-2025 timeout-minutes: 30 strategy: fail-fast: false diff --git a/.github/workflows/update-win-version.yml b/.github/workflows/update-win-version.yml index 929908b0a0e2..bbc9f86191ce 100644 --- a/.github/workflows/update-win-version.yml +++ b/.github/workflows/update-win-version.yml @@ -13,7 +13,7 @@ on: jobs: update-win-version: timeout-minutes: 60 - runs-on: windows-2022 + runs-on: windows-2025 strategy: fail-fast: false matrix: