diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml index 69a1a43..71e9c40 100755 --- a/.github/workflows/build-windows.yml +++ b/.github/workflows/build-windows.yml @@ -190,4 +190,62 @@ jobs: uses: actions/upload-artifact@v3 with: name: windows-release-build - path: build/windows/runner/Release/ \ No newline at end of file + path: build/windows/runner/Release/ + + # 本地(act)验证作业:只验证 Git PATH 与 checkout/submodules + build-act-windows: + name: ACT Windows Checkout Verification + if: ${{ env.ACT == 'true' }} + runs-on: windows-latest + steps: + - name: Add Git to PATH (Windows) + shell: powershell + run: | + $paths = @( + 'C:\Program Files\Git\cmd', + 'C:\Program Files\Git\bin', + 'C:\Program Files (x86)\Git\cmd', + 'C:\Program Files (x86)\Git\bin' + ) + foreach ($p in $paths) { + if (Test-Path $p) { + Add-Content -Path $env:GITHUB_PATH -Value $p + $env:PATH = "$p;$env:PATH" + Write-Host ("Added to PATH: {0}" -f $p) + } + } + $candidates = @( + 'C:\Program Files\Git\cmd\git.exe', + 'C:\Program Files\Git\bin\git.exe', + 'C:\Program Files (x86)\Git\cmd\git.exe', + 'C:\Program Files (x86)\Git\bin\git.exe' + ) + $found = $false + foreach ($g in $candidates) { + if (Test-Path $g) { + & $g --version + $found = $true + break + } + } + if (-not $found) { + Write-Host "Git executable not found in common locations; continuing." + } + + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: recursive + fetch-depth: 0 + + - name: Verify submodules + shell: powershell + run: | + git --version + git submodule status + Write-Host "Submodules verified (status printed above)." + + - name: Summary + shell: powershell + run: | + Write-Host "ACT Windows verification completed successfully." \ No newline at end of file