From 7bf41349540b651e9b5beaa09bd952a807daabc8 Mon Sep 17 00:00:00 2001 From: Fabrice de Gans Date: Thu, 29 May 2025 11:19:52 -0700 Subject: [PATCH] setup-build: Fix the output value The output value for the action was not properly set. --- .github/actions/setup-build/action.yml | 2 +- .github/workflows/test-setup-build.yml | 22 ++++++++++++++++++++-- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/.github/actions/setup-build/action.yml b/.github/actions/setup-build/action.yml index 0d7a4fc8c..49cc4c055 100644 --- a/.github/actions/setup-build/action.yml +++ b/.github/actions/setup-build/action.yml @@ -28,7 +28,7 @@ outputs: description: | The full version of the Windows build tools installed, eg. "14.42.34433". This is only set if the `msvc-version` input was provided, and only on Windows. - value: ${{ steps.install-msvc.outputs.windows-build-tools-version }} + value: ${{ steps.setup-msvc.outputs.windows-build-tools-version }} runs: using: composite diff --git a/.github/workflows/test-setup-build.yml b/.github/workflows/test-setup-build.yml index 02c0e6ae3..d100592aa 100644 --- a/.github/workflows/test-setup-build.yml +++ b/.github/workflows/test-setup-build.yml @@ -22,6 +22,7 @@ on: env: TEST_WIN_SDK_VERSION: "10.0.22000.0" TEST_MSVC_VERSION: "14.40" + TEST_BUILD_TOOLS_EXPECTED_VERSION: "14.40.33807" jobs: test-setup-build-windows-vs-dev-env: @@ -77,11 +78,19 @@ jobs: Write-Output "✅ No unexpected Windows SDK versions greater than `"${env:TEST_WIN_SDK_VERSION}`" found." } + $BuildToolsVersion = "${{ steps.setup-build.outputs.windows-build-tools-version }}" + if ($BuildToolsVersion -ne $env:TEST_BUILD_TOOLS_EXPECTED_VERSION) { + Write-Output "::error::Expected build tools version `"${env:TEST_BUILD_TOOLS_EXPECTED_VERSION}`", but got `"${BuildToolsVersion}`"." + $HasError = $true + } else { + Write-Output "✅ Build tools version `${BuildToolsVersion}` matches expected version." + } + # Check if the correct MSVC version is installed. $InstallerLocation = Join-Path "${env:ProgramFiles(x86)}" "Microsoft Visual Studio" "Installer" $VSWhere = Join-Path "${InstallerLocation}" "vswhere.exe" $InstallPath = (& "$VSWhere" -latest -products * -format json | ConvertFrom-Json).installationPath - $MSVCDir = Join-Path $InstallPath "VC" "Tools" "MSVC" "${{ steps.setup-build.outputs.windows-build-tools-version }}" + $MSVCDir = Join-Path $InstallPath "VC" "Tools" "MSVC" $BuildToolsVersion if (Test-Path -Path $MSVCDir) { Write-Output "✅ MSVC version `${env:TEST_MSVC_VERSION}`" is installed." } else { @@ -174,11 +183,20 @@ jobs: Write-Output "✅ No unexpected Windows SDK versions greater than `"${env:TEST_WIN_SDK_VERSION}`" found." } + # Check the action output. + $BuildToolsVersion = "${{ steps.setup-build.outputs.windows-build-tools-version }}" + if ($BuildToolsVersion -ne $env:TEST_BUILD_TOOLS_EXPECTED_VERSION) { + Write-Output "::error::Expected build tools version `"${env:TEST_BUILD_TOOLS_EXPECTED_VERSION}`", but got `"${BuildToolsVersion}`"." + $HasError = $true + } else { + Write-Output "✅ Build tools version `${BuildToolsVersion}` matches expected version." + } + # Check if the correct MSVC version is installed. $InstallerLocation = Join-Path "${env:ProgramFiles(x86)}" "Microsoft Visual Studio" "Installer" $VSWhere = Join-Path "${InstallerLocation}" "vswhere.exe" $InstallPath = (& "$VSWhere" -latest -products * -format json | ConvertFrom-Json).installationPath - $MSVCDir = Join-Path $InstallPath "VC" "Tools" "MSVC" "${{ steps.setup-build.outputs.windows-build-tools-version }}" + $MSVCDir = Join-Path $InstallPath "VC" "Tools" "MSVC" $BuildToolsVersion if (Test-Path -Path $MSVCDir) { Write-Output "✅ MSVC version `${env:TEST_MSVC_VERSION}`" is installed." } else {