Skip to content

Commit 90a904d

Browse files
committed
setup-build: Add more logging
1 parent d4dd221 commit 90a904d

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

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

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ runs:
108108
109109
- name: Install Windows SDK version ${{ inputs.windows-sdk-version }}
110110
if: steps.sanitize-input.outputs.build-os == 'windows' && inputs.windows-sdk-version != ''
111-
id: setup-windows-sdk
112111
shell: pwsh
113112
run: |
114113
$WinSdkVersionString = "${{ inputs.windows-sdk-version }}"
@@ -136,6 +135,7 @@ runs:
136135
-PassThru `
137136
-ArgumentList "modify", `
138137
"--noUpdateInstaller", `
138+
"--log", "${env:TEMP}\vs_installer_log_winsdk.log", `
139139
"--installPath", "`"$InstallPath`"", `
140140
"--channelId", "https://aka.ms/vs/17/release/channel", `
141141
"--quiet", "--norestart", "--nocache", `
@@ -146,8 +146,6 @@ runs:
146146
Write-Output "ℹ️ Windows SDK ${WinSdkVersionString} installed successfully."
147147
} else {
148148
Write-Output "::error::Failed to install Windows SDK ${WinSdkVersionString}. Check the installer log for details."
149-
$LogFile = Get-ChildItem "${env:TEMP}" -Filter "dd_installer_*.log" | Sort-Object LastWriteTime -Descending | Select-Object -First 1
150-
"log-file=$($LogFile.FullName)" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
151149
exit 1
152150
}
153151
}
@@ -176,11 +174,10 @@ runs:
176174
uses: actions/upload-artifact@v4
177175
with:
178176
name: ${{ github.job }}-windows-sdk-installer-log
179-
path: ${{ steps.setup-windows-sdk.outputs.log-file }}
177+
path: ${{ env.TEMP }}/vs_installer_log_winsdk.log"
180178

181179
- name: Install Windows MSVC version ${{ inputs.msvc-version }}
182180
if: steps.sanitize-input.outputs.build-os == 'windows' && inputs.msvc-version != ''
183-
id: setup-msvc
184181
shell: pwsh
185182
run: |
186183
# This is assuming a VS2022 toolchain. e.g.
@@ -212,6 +209,7 @@ runs:
212209
-PassThru `
213210
-ArgumentList "modify", `
214211
"--noUpdateInstaller", `
212+
"--log", "${env:TEMP}\vs_installer_log_msvc.log", `
215213
"--installPath", "`"$InstallPath`"", `
216214
"--channelId", "https://aka.ms/vs/17/release/channel", `
217215
"--quiet", "--norestart", "--nocache", `
@@ -234,8 +232,6 @@ runs:
234232
235233
if ($MSVCBuildToolsVersion -eq "") {
236234
Write-Output "::error::Failed to install MSVC ${MSVCVersionString}. Check the installer log for details."
237-
$LogFile = Get-ChildItem "${env:TEMP}" -Filter "dd_installer_*.log" | Sort-Object LastWriteTime -Descending | Select-Object -First 1
238-
"log-file=$($LogFile.FullName)" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
239235
exit 1
240236
} else {
241237
Write-Output "ℹ️ MSVC ${MSVCBuildToolsVersion} installed successfully."
@@ -247,7 +243,7 @@ runs:
247243
uses: actions/upload-artifact@v4
248244
with:
249245
name: ${{ github.job }}-msvc-installer-log
250-
path: ${{ steps.setup-msvc.outputs.log-file }}
246+
path: ${{ env.TEMP }}/vs_installer_log_msvc.log"
251247

252248
- name: Setup Visual Studio Developer Environment
253249
if: steps.sanitize-input.outputs.build-os == 'windows' && inputs.setup-vs-dev-env == 'true'

0 commit comments

Comments
 (0)