Skip to content

Commit 44bfd45

Browse files
authored
setup-build: Fix the output value (#966)
The output value for the action was not properly set.
1 parent 85e7154 commit 44bfd45

File tree

2 files changed

+21
-3
lines changed

2 files changed

+21
-3
lines changed

.github/actions/setup-build/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ outputs:
2828
description: |
2929
The full version of the Windows build tools installed, eg. "14.42.34433". This is only set
3030
if the `msvc-version` input was provided, and only on Windows.
31-
value: ${{ steps.install-msvc.outputs.windows-build-tools-version }}
31+
value: ${{ steps.setup-msvc.outputs.windows-build-tools-version }}
3232

3333
runs:
3434
using: composite

.github/workflows/test-setup-build.yml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ on:
2222
env:
2323
TEST_WIN_SDK_VERSION: "10.0.22000.0"
2424
TEST_MSVC_VERSION: "14.40"
25+
TEST_BUILD_TOOLS_EXPECTED_VERSION: "14.40.33807"
2526

2627
jobs:
2728
test-setup-build-windows-vs-dev-env:
@@ -77,11 +78,19 @@ jobs:
7778
Write-Output "✅ No unexpected Windows SDK versions greater than `"${env:TEST_WIN_SDK_VERSION}`" found."
7879
}
7980
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+
8089
# Check if the correct MSVC version is installed.
8190
$InstallerLocation = Join-Path "${env:ProgramFiles(x86)}" "Microsoft Visual Studio" "Installer"
8291
$VSWhere = Join-Path "${InstallerLocation}" "vswhere.exe"
8392
$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
8594
if (Test-Path -Path $MSVCDir) {
8695
Write-Output "✅ MSVC version `${env:TEST_MSVC_VERSION}`" is installed."
8796
} else {
@@ -174,11 +183,20 @@ jobs:
174183
Write-Output "✅ No unexpected Windows SDK versions greater than `"${env:TEST_WIN_SDK_VERSION}`" found."
175184
}
176185
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+
177195
# Check if the correct MSVC version is installed.
178196
$InstallerLocation = Join-Path "${env:ProgramFiles(x86)}" "Microsoft Visual Studio" "Installer"
179197
$VSWhere = Join-Path "${InstallerLocation}" "vswhere.exe"
180198
$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
182200
if (Test-Path -Path $MSVCDir) {
183201
Write-Output "✅ MSVC version `${env:TEST_MSVC_VERSION}`" is installed."
184202
} else {

0 commit comments

Comments
 (0)