@@ -37,6 +37,11 @@ on:
|
37 | 37 | required: false |
38 | 38 | default: false |
39 | 39 | type: boolean |
| 40 | +run_windows_ci: |
| 41 | +description: "Run the focused Windows-native CI test shard after probing" |
| 42 | +required: false |
| 43 | +default: false |
| 44 | +type: boolean |
40 | 45 | |
41 | 46 | permissions: |
42 | 47 | contents: read |
@@ -168,7 +173,85 @@ jobs:
|
168 | 173 | |
169 | 174 | exit 0 |
170 | 175 | |
| 176 | + - name: Try to exclude workspace from Windows Defender (best-effort) |
| 177 | +if: ${{ inputs.run_windows_ci }} |
| 178 | +shell: pwsh |
| 179 | +run: | |
| 180 | + $cmd = Get-Command Add-MpPreference -ErrorAction SilentlyContinue |
| 181 | + if (-not $cmd) { |
| 182 | + Write-Host "Add-MpPreference not available, skipping Defender exclusions." |
| 183 | + exit 0 |
| 184 | + } |
| 185 | + |
| 186 | + try { |
| 187 | + Add-MpPreference -ExclusionPath "$env:GITHUB_WORKSPACE" -ErrorAction Stop |
| 188 | + Add-MpPreference -ExclusionProcess "node.exe" -ErrorAction Stop |
| 189 | + Write-Host "Defender exclusions applied." |
| 190 | + } catch { |
| 191 | + Write-Warning "Failed to apply Defender exclusions, continuing. $($_.Exception.Message)" |
| 192 | + } |
| 193 | + |
| 194 | + - name: Setup Node.js |
| 195 | +if: ${{ inputs.run_windows_ci }} |
| 196 | +shell: bash |
| 197 | +env: |
| 198 | +REQUESTED_NODE_VERSION: "22.x" |
| 199 | +run: | |
| 200 | + set -euo pipefail |
| 201 | + source .github/actions/setup-pnpm-store-cache/ensure-node.sh |
| 202 | + openclaw_ensure_node "$REQUESTED_NODE_VERSION" |
| 203 | + |
| 204 | + - name: Setup pnpm |
| 205 | +if: ${{ inputs.run_windows_ci }} |
| 206 | +uses: ./.github/actions/setup-pnpm-store-cache |
| 207 | +with: |
| 208 | +node-version: 22.x |
| 209 | + |
| 210 | + - name: Runtime versions |
| 211 | +if: ${{ inputs.run_windows_ci }} |
| 212 | +shell: bash |
| 213 | +run: | |
| 214 | + node -v |
| 215 | + npm -v |
| 216 | + pnpm -v |
| 217 | + |
| 218 | + - name: Capture node path |
| 219 | +if: ${{ inputs.run_windows_ci }} |
| 220 | +shell: bash |
| 221 | +run: | |
| 222 | + node_bin="$(dirname "$(node -p 'process.execPath')")" |
| 223 | + if command -v cygpath >/dev/null 2>&1; then |
| 224 | + node_bin="$(cygpath -u "$node_bin")" |
| 225 | + fi |
| 226 | + echo "NODE_BIN=$node_bin" >> "$GITHUB_ENV" |
| 227 | + |
| 228 | + - name: Install dependencies |
| 229 | +if: ${{ inputs.run_windows_ci }} |
| 230 | +shell: bash |
| 231 | +env: |
| 232 | +CI: true |
| 233 | +run: | |
| 234 | + export PATH="$NODE_BIN:$PATH" |
| 235 | + which node |
| 236 | + node -v |
| 237 | + pnpm -v |
| 238 | + pnpm install --frozen-lockfile --prefer-offline --ignore-scripts=false --config.engine-strict=false --config.enable-pre-post-scripts=true --config.side-effects-cache=true || pnpm install --frozen-lockfile --prefer-offline --ignore-scripts=false --config.engine-strict=false --config.enable-pre-post-scripts=true --config.side-effects-cache=true |
| 239 | + |
| 240 | + - name: Run Windows CI tests |
| 241 | +if: ${{ inputs.run_windows_ci }} |
| 242 | +shell: bash |
| 243 | +env: |
| 244 | +CI: true |
| 245 | +NODE_OPTIONS: --max-old-space-size=8192 |
| 246 | +OPENCLAW_TEST_SKIP_FULL_EXTENSIONS_SHARD: 1 |
| 247 | +OPENCLAW_VITEST_MAX_WORKERS: 1 |
| 248 | +run: | |
| 249 | + set -euo pipefail |
| 250 | + export PATH="$NODE_BIN:$PATH" |
| 251 | + pnpm test:windows:ci |
| 252 | + |
171 | 253 | - name: Keep runner alive for SSH inspection |
| 254 | +if: ${{ always() && !cancelled() }} |
172 | 255 | env: |
173 | 256 | KEEPALIVE_MINUTES: ${{ inputs.keepalive_minutes }} |
174 | 257 | run: | |
@@ -185,7 +268,7 @@ jobs:
|
185 | 268 | } |
186 | 269 | |
187 | 270 | - name: Enforce WSL2 requirement |
188 | | -if: ${{ inputs.require_wsl2 }} |
| 271 | +if: ${{ always() && !cancelled() && inputs.require_wsl2 }} |
189 | 272 | run: | |
190 | 273 | if ($env:OPENCLAW_WSL2_PROBE_OK -ne "true") { |
191 | 274 | Write-Error "WSL2 probe failed or WSL2 is unavailable on this Windows runner." |
|