























@@ -0,0 +1,111 @@
1+name: Windows Testbox Probe
2+3+on:
4+workflow_dispatch:
5+inputs:
6+target_ref:
7+description: "Git ref or SHA to check out"
8+required: false
9+default: "main"
10+type: string
11+keepalive_minutes:
12+description: "Minutes to keep the Windows runner alive for SSH inspection"
13+required: false
14+default: "20"
15+type: string
16+require_wsl2:
17+description: "Fail the run when WSL2 is unavailable"
18+required: false
19+default: false
20+type: boolean
21+22+permissions:
23+contents: read
24+25+env:
26+FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true"
27+28+jobs:
29+probe:
30+name: Windows probe
31+runs-on: ${{ github.repository == 'openclaw/openclaw' && 'blacksmith-16vcpu-windows-2025' || 'windows-2025' }}
32+timeout-minutes: 75
33+defaults:
34+run:
35+shell: pwsh
36+steps:
37+ - name: Checkout
38+uses: actions/checkout@v6
39+with:
40+ref: ${{ inputs.target_ref || github.ref }}
41+persist-credentials: false
42+submodules: false
43+44+ - name: Probe native Windows
45+run: |
46+ $ErrorActionPreference = "Stop"
47+ Write-Host "runner=$env:RUNNER_NAME"
48+ Write-Host "machine=$env:COMPUTERNAME"
49+ Write-Host "workspace=$env:GITHUB_WORKSPACE"
50+ Write-Host "target_ref=${{ inputs.target_ref || github.ref }}"
51+ Write-Host ("os=" + [System.Environment]::OSVersion.VersionString)
52+ Write-Host ("arch=" + [System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture)
53+ Write-Host ("powershell=" + $PSVersionTable.PSVersion.ToString())
54+ cmd.exe /c ver
55+ git --version
56+57+ - name: Probe WSL2
58+id: wsl2
59+run: |
60+ $ErrorActionPreference = "Continue"
61+ $ok = $false
62+63+ $wsl = Get-Command wsl.exe -ErrorAction SilentlyContinue
64+ if (-not $wsl) {
65+ Write-Warning "wsl.exe is not available on this runner."
66+ } else {
67+ Write-Host "wsl.exe=$($wsl.Source)"
68+ wsl.exe --status
69+ Write-Host "wsl_status_exit=$LASTEXITCODE"
70+ wsl.exe --list --verbose
71+ Write-Host "wsl_list_exit=$LASTEXITCODE"
72+ wsl.exe --exec bash -lc 'set -euo pipefail; uname -a; if [ -f /etc/os-release ]; then sed -n "1,8p" /etc/os-release; fi'
73+ if ($LASTEXITCODE -eq 0) {
74+ $ok = $true
75+ }
76+ Write-Host "wsl_exec_exit=$LASTEXITCODE"
77+ }
78+79+ if ($ok) {
80+ "wsl2_ok=true" >> $env:GITHUB_OUTPUT
81+ "OPENCLAW_WSL2_PROBE_OK=true" >> $env:GITHUB_ENV
82+ Write-Host "wsl2_ok=true"
83+ } else {
84+ "wsl2_ok=false" >> $env:GITHUB_OUTPUT
85+ "OPENCLAW_WSL2_PROBE_OK=false" >> $env:GITHUB_ENV
86+ Write-Warning "wsl2_ok=false"
87+ }
88+89+ - name: Keep runner alive for SSH inspection
90+env:
91+KEEPALIVE_MINUTES: ${{ inputs.keepalive_minutes }}
92+run: |
93+ $ErrorActionPreference = "Stop"
94+ $minutes = 20
95+ if ($env:KEEPALIVE_MINUTES -match '^\d+$') {
96+ $minutes = [int]$env:KEEPALIVE_MINUTES
97+ }
98+ $minutes = [Math]::Max(0, [Math]::Min($minutes, 60))
99+ Write-Host "keepalive_minutes=$minutes"
100+ for ($i = 1; $i -le $minutes; $i++) {
101+ Write-Host "keepalive minute $i/$minutes"
102+ Start-Sleep -Seconds 60
103+ }
104+105+ - name: Enforce WSL2 requirement
106+if: ${{ inputs.require_wsl2 }}
107+run: |
108+ if ($env:OPENCLAW_WSL2_PROBE_OK -ne "true") {
109+ Write-Error "WSL2 probe failed or WSL2 is unavailable on this Windows runner."
110+ exit 1
111+ }
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。