Skip to content

Commit ccff988

Browse files
committed
#75 edit xbox-host-ci.yml
1 parent e036c5b commit ccff988

1 file changed

Lines changed: 72 additions & 29 deletions

File tree

.github/workflows/xbox-host-ci.yml

Lines changed: 72 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,23 @@ jobs:
4949
runs-on: windows-2022
5050
steps:
5151
- uses: actions/checkout@v6
52-
- uses: ilammy/msvc-dev-cmd@v1
52+
# MSVC 環境 (vcvars64) をサードパーティ action なしで設定する。
53+
# ilammy/msvc-dev-cmd は Node20 非推奨警告が出るため、実体である
54+
# 「vcvars64.bat を実行して環境変数を GITHUB_ENV へ書き出す」処理を直接行う。
55+
- name: Setup MSVC environment (vcvars64)
56+
shell: pwsh
57+
run: |
58+
$vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe"
59+
$vs = & $vswhere -latest -products * `
60+
-requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 `
61+
-property installationPath
62+
if (-not $vs) { Write-Error "Visual Studio (VC tools) not found"; exit 1 }
63+
cmd /s /c "`"$vs\VC\Auxiliary\Build\vcvars64.bat`" > NUL && set" | ForEach-Object {
64+
if ($_ -match '^([^=]+)=(.*)$') {
65+
Add-Content $env:GITHUB_ENV "$($Matches[1])=$($Matches[2])"
66+
}
67+
}
68+
Write-Host "MSVC env exported from: $vs"
5369
5470
- name: Build & run RasterCore tests
5571
shell: cmd
@@ -84,51 +100,78 @@ jobs:
84100
runs-on: windows-2022
85101
steps:
86102
- uses: actions/checkout@v6
87-
- uses: ilammy/msvc-dev-cmd@v1
103+
# MSVC 環境 (vcvars64) をサードパーティ action なしで設定する。
104+
# ilammy/msvc-dev-cmd は Node20 非推奨警告が出るため、実体である
105+
# 「vcvars64.bat を実行して環境変数を GITHUB_ENV へ書き出す」処理を直接行う。
106+
- name: Setup MSVC environment (vcvars64)
107+
shell: pwsh
108+
run: |
109+
$vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe"
110+
$vs = & $vswhere -latest -products * `
111+
-requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 `
112+
-property installationPath
113+
if (-not $vs) { Write-Error "Visual Studio (VC tools) not found"; exit 1 }
114+
cmd /s /c "`"$vs\VC\Auxiliary\Build\vcvars64.bat`" > NUL && set" | ForEach-Object {
115+
if ($_ -match '^([^=]+)=(.*)$') {
116+
Add-Content $env:GITHUB_ENV "$($Matches[1])=$($Matches[2])"
117+
}
118+
}
119+
Write-Host "MSVC env exported from: $vs"
88120
89121
# ホストがコンソールでも使う API: 全て GAMES パーティションに必要 (欠落は fail)。
90-
# 事前のローカル監査 (SDK 22621/26100/28000 のヘッダ解析) では全て GAMES 可視の
91-
# はずなので、失敗時はエラー全文を出して原因 (SDK 差異/ヘッダ問題) を特定する。
122+
# 事前のローカル監査 (SDK 22621/26100/28000 のヘッダ解析) では全て GAMES 可視。
123+
# NOTE: cmd の複数行 if ブロックは括弧/errorlevel の罠が多い (2 回誤爆) ため、
124+
# v8-syntax-check と同じ pwsh + $LASTEXITCODE 方式に統一。
92125
- name: Host APIs must exist in GAMES partition
93-
shell: cmd
126+
shell: pwsh
94127
working-directory: templates/xbox
95128
run: |
96-
rem 注意: cmd の if ブロック内の echo に半角 ( ) を含めてはならない —
97-
rem ')' がブロックを途中で閉じ、以降の行が無条件実行される (前回の誤爆原因)。
98-
echo SDK: %WindowsSDKVersion%
99-
cl /nologo /std:c++17 /W3 /c /DWINAPI_FAMILY=WINAPI_FAMILY_GAMES ^
100-
tests\gamecore_api_probe.cpp > host_probe.log 2>&1
101-
if errorlevel 1 (
102-
type host_probe.log
103-
echo ::error::Game Core host API probe failed - see host_probe.log above
104-
exit /b 1
105-
)
106-
type host_probe.log
107-
echo OK: host APIs are all present in the GAMES partition
129+
Write-Host "SDK: $env:WindowsSDKVersion"
130+
cl /nologo /std:c++17 /W3 /c /DWINAPI_FAMILY=WINAPI_FAMILY_GAMES `
131+
tests/gamecore_api_probe.cpp
132+
if ($LASTEXITCODE -ne 0) {
133+
Write-Host "::error::Game Core host API probe failed (cl errors above)"
134+
exit 1
135+
}
136+
Write-Host "OK: host APIs are all present in the GAMES partition"
108137
109138
# V8 platform 層の API: 欠落 = 移植時の置換 TODO リスト (情報提供、fail しない)
110139
- name: V8 platform-layer APIs (informational TODO list)
111-
shell: cmd
140+
shell: pwsh
112141
working-directory: templates/xbox
113142
run: |
114-
cl /nologo /std:c++17 /W3 /c /DWINAPI_FAMILY=WINAPI_FAMILY_GAMES /DPROBE_V8 ^
115-
tests\gamecore_api_probe.cpp > v8probe.log 2>&1
116-
if errorlevel 1 (
117-
echo === V8 porting TODO: these APIs are NOT in the GAMES partition ===
118-
findstr /C:"error C" v8probe.log
119-
echo === all other probed V8 platform APIs are available ===
120-
) else (
121-
echo OK: V8 platform APIs are all present in the GAMES partition
122-
)
123-
exit /b 0
143+
cl /nologo /std:c++17 /W3 /c /DWINAPI_FAMILY=WINAPI_FAMILY_GAMES /DPROBE_V8 `
144+
tests/gamecore_api_probe.cpp
145+
if ($LASTEXITCODE -ne 0) {
146+
Write-Host "=== The cl errors above = V8 porting TODO (APIs not in GAMES partition) ==="
147+
} else {
148+
Write-Host "OK: V8 platform APIs are all present in the GAMES partition"
149+
}
150+
exit 0
124151
125152
v8-syntax-check:
126153
name: V8-dependent sources compile check (MSVC)
127154
# VS2022 (v143) 世代に固定 — GDK ビルドの実ターゲットと同じ toolset で検証する
128155
runs-on: windows-2022
129156
steps:
130157
- uses: actions/checkout@v6
131-
- uses: ilammy/msvc-dev-cmd@v1
158+
# MSVC 環境 (vcvars64) をサードパーティ action なしで設定する。
159+
# ilammy/msvc-dev-cmd は Node20 非推奨警告が出るため、実体である
160+
# 「vcvars64.bat を実行して環境変数を GITHUB_ENV へ書き出す」処理を直接行う。
161+
- name: Setup MSVC environment (vcvars64)
162+
shell: pwsh
163+
run: |
164+
$vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe"
165+
$vs = & $vswhere -latest -products * `
166+
-requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 `
167+
-property installationPath
168+
if (-not $vs) { Write-Error "Visual Studio (VC tools) not found"; exit 1 }
169+
cmd /s /c "`"$vs\VC\Auxiliary\Build\vcvars64.bat`" > NUL && set" | ForEach-Object {
170+
if ($_ -match '^([^=]+)=(.*)$') {
171+
Add-Content $env:GITHUB_ENV "$($Matches[1])=$($Matches[2])"
172+
}
173+
}
174+
Write-Host "MSVC env exported from: $vs"
132175
133176
- name: Fetch V8 headers (${{ env.V8_TAG }})
134177
shell: pwsh

0 commit comments

Comments
 (0)