Skip to content

Commit 0c14332

Browse files
Copilottrask
andcommitted
Fix Windows CI build by adding proper Visual Studio and Windows SDK setup
Co-authored-by: trask <[email protected]>
1 parent 6d8af0f commit 0c14332

File tree

2 files changed

+18
-5
lines changed

2 files changed

+18
-5
lines changed

.github/workflows/build-common.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,19 @@ jobs:
106106
- name: Add MSBuild to PATH
107107
uses: microsoft/setup-msbuild@v2
108108

109+
- name: Setup Windows 10 SDK
110+
uses: GuillaumeFalourd/setup-windows10-sdk-action@v2
111+
with:
112+
sdk-version: 22621
113+
114+
- name: Setup Visual Studio environment
115+
shell: cmd
116+
run: |
117+
"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath > vs.txt
118+
set /p VSPATH=<vs.txt
119+
echo APPINSIGHTS_VS_PATH=%VSPATH%>>%GITHUB_ENV%
120+
echo APPINSIGHTS_WIN10_SDK_PATH=C:\Program Files (x86)\Windows Kits\10>>%GITHUB_ENV%
121+
109122
- name: Assemble
110123
# javadoc task fails sporadically fetching https://docs.oracle.com/javase/8/docs/api/
111124
run: >

etw/native/build.gradle

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ if (System.env.APPINSIGHTS_WIN10_SDK_PATH) {
1313
winSdkDir = System.env.APPINSIGHTS_WIN10_SDK_PATH
1414
logger.info "Windows SDK path set with environment variable, APPINSIGHTS_WIN10_SDK_PATH"
1515
}
16-
// Visual Studio 2022 Build Tools path for GitHub Actions windows-2022 runners
17-
def vsToolsDir = "$programFilesX86/Microsoft Visual Studio/2022/BuildTools"
18-
16+
// Visual Studio Build Tools path - use environment variable if available, fallback to standard path
17+
def vsToolsDir = System.env.APPINSIGHTS_VS_PATH ?: "$programFilesX86/Microsoft Visual Studio/2022/BuildTools"
1918
if (System.env.APPINSIGHTS_VS_PATH) {
20-
vsToolsDir = System.env.APPINSIGHTS_VS_PATH
21-
logger.info "Visual Studio Build Tools path set with environment variable, APPINSIGHTS_VS_PATH"
19+
logger.info "Visual Studio Build Tools path set with environment variable: $vsToolsDir"
20+
} else {
21+
logger.info "Using default Visual Studio Build Tools path: $vsToolsDir"
2222
}
2323

2424
logger.info "Windows SDK: $winSdkDir"

0 commit comments

Comments
 (0)