Skip to content

Commit b57d585

Browse files
committed
setup-build: Fix the output value
The output value for the action was not properly set.
1 parent 85e7154 commit b57d585

File tree

2 files changed

+22
-3
lines changed

2 files changed

+22
-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: 21 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,20 @@ jobs:
7778
Write-Output "✅ No unexpected Windows SDK versions greater than `"${env:TEST_WIN_SDK_VERSION}`" found."
7879
}
7980
81+
# Check the action output.
82+
$BuildToolsVersion = ${{ steps.setup-build.outputs.windows-build-tools-version }}
83+
if ($BuildToolsVersion -ne $env:TEST_BUILD_TOOLS_EXPECTED_VERSION) {
84+
Write-Output "::error::Expected build tools version `${env:TEST_BUILD_TOOLS_EXPECTED_VERSION}`, but got `${BuildToolsVersion}`."
85+
$HasError = $true
86+
} else {
87+
Write-Output "✅ Build tools version `${BuildToolsVersion}` matches expected version."
88+
}
89+
8090
# Check if the correct MSVC version is installed.
8191
$InstallerLocation = Join-Path "${env:ProgramFiles(x86)}" "Microsoft Visual Studio" "Installer"
8292
$VSWhere = Join-Path "${InstallerLocation}" "vswhere.exe"
8393
$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 }}"
94+
$MSVCDir = Join-Path $InstallPath "VC" "Tools" "MSVC" $BuildToolsVersion
8595
if (Test-Path -Path $MSVCDir) {
8696
Write-Output "✅ MSVC version `${env:TEST_MSVC_VERSION}`" is installed."
8797
} else {
@@ -174,11 +184,20 @@ jobs:
174184
Write-Output "✅ No unexpected Windows SDK versions greater than `"${env:TEST_WIN_SDK_VERSION}`" found."
175185
}
176186
187+
# Check the action output.
188+
$BuildToolsVersion = "${{ steps.setup-build.outputs.windows-build-tools-version }}"
189+
if ($BuildToolsVersion -ne $env:TEST_BUILD_TOOLS_EXPECTED_VERSION) {
190+
Write-Output "::error::Expected build tools version `"${env:TEST_BUILD_TOOLS_EXPECTED_VERSION}`", but got `"${BuildToolsVersion}`"."
191+
$HasError = $true
192+
} else {
193+
Write-Output "✅ Build tools version `${BuildToolsVersion}` matches expected version."
194+
}
195+
177196
# Check if the correct MSVC version is installed.
178197
$InstallerLocation = Join-Path "${env:ProgramFiles(x86)}" "Microsoft Visual Studio" "Installer"
179198
$VSWhere = Join-Path "${InstallerLocation}" "vswhere.exe"
180199
$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 }}"
200+
$MSVCDir = Join-Path $InstallPath "VC" "Tools" "MSVC" $BuildToolsVersion
182201
if (Test-Path -Path $MSVCDir) {
183202
Write-Output "✅ MSVC version `${env:TEST_MSVC_VERSION}`" is installed."
184203
} else {

0 commit comments

Comments
 (0)