|
22 | 22 | env: |
23 | 23 | TEST_WIN_SDK_VERSION: "10.0.22000.0" |
24 | 24 | TEST_MSVC_VERSION: "14.40" |
| 25 | + TEST_BUILD_TOOLS_EXPECTED_VERSION: "14.40.33807" |
25 | 26 |
|
26 | 27 | jobs: |
27 | 28 | test-setup-build-windows-vs-dev-env: |
@@ -77,11 +78,19 @@ jobs: |
77 | 78 | Write-Output "✅ No unexpected Windows SDK versions greater than `"${env:TEST_WIN_SDK_VERSION}`" found." |
78 | 79 | } |
79 | 80 |
|
| 81 | + $BuildToolsVersion = "${{ steps.setup-build.outputs.windows-build-tools-version }}" |
| 82 | + if ($BuildToolsVersion -ne $env:TEST_BUILD_TOOLS_EXPECTED_VERSION) { |
| 83 | + Write-Output "::error::Expected build tools version `"${env:TEST_BUILD_TOOLS_EXPECTED_VERSION}`", but got `"${BuildToolsVersion}`"." |
| 84 | + $HasError = $true |
| 85 | + } else { |
| 86 | + Write-Output "✅ Build tools version `${BuildToolsVersion}` matches expected version." |
| 87 | + } |
| 88 | +
|
80 | 89 | # Check if the correct MSVC version is installed. |
81 | 90 | $InstallerLocation = Join-Path "${env:ProgramFiles(x86)}" "Microsoft Visual Studio" "Installer" |
82 | 91 | $VSWhere = Join-Path "${InstallerLocation}" "vswhere.exe" |
83 | 92 | $InstallPath = (& "$VSWhere" -latest -products * -format json | ConvertFrom-Json).installationPath |
84 | | - $MSVCDir = Join-Path $InstallPath "VC" "Tools" "MSVC" "${{ steps.setup-build.outputs.windows-build-tools-version }}" |
| 93 | + $MSVCDir = Join-Path $InstallPath "VC" "Tools" "MSVC" $BuildToolsVersion |
85 | 94 | if (Test-Path -Path $MSVCDir) { |
86 | 95 | Write-Output "✅ MSVC version `${env:TEST_MSVC_VERSION}`" is installed." |
87 | 96 | } else { |
@@ -174,11 +183,20 @@ jobs: |
174 | 183 | Write-Output "✅ No unexpected Windows SDK versions greater than `"${env:TEST_WIN_SDK_VERSION}`" found." |
175 | 184 | } |
176 | 185 |
|
| 186 | + # Check the action output. |
| 187 | + $BuildToolsVersion = "${{ steps.setup-build.outputs.windows-build-tools-version }}" |
| 188 | + if ($BuildToolsVersion -ne $env:TEST_BUILD_TOOLS_EXPECTED_VERSION) { |
| 189 | + Write-Output "::error::Expected build tools version `"${env:TEST_BUILD_TOOLS_EXPECTED_VERSION}`", but got `"${BuildToolsVersion}`"." |
| 190 | + $HasError = $true |
| 191 | + } else { |
| 192 | + Write-Output "✅ Build tools version `${BuildToolsVersion}` matches expected version." |
| 193 | + } |
| 194 | +
|
177 | 195 | # Check if the correct MSVC version is installed. |
178 | 196 | $InstallerLocation = Join-Path "${env:ProgramFiles(x86)}" "Microsoft Visual Studio" "Installer" |
179 | 197 | $VSWhere = Join-Path "${InstallerLocation}" "vswhere.exe" |
180 | 198 | $InstallPath = (& "$VSWhere" -latest -products * -format json | ConvertFrom-Json).installationPath |
181 | | - $MSVCDir = Join-Path $InstallPath "VC" "Tools" "MSVC" "${{ steps.setup-build.outputs.windows-build-tools-version }}" |
| 199 | + $MSVCDir = Join-Path $InstallPath "VC" "Tools" "MSVC" $BuildToolsVersion |
182 | 200 | if (Test-Path -Path $MSVCDir) { |
183 | 201 | Write-Output "✅ MSVC version `${env:TEST_MSVC_VERSION}`" is installed." |
184 | 202 | } else { |
|
0 commit comments