ci: fix Windows tests silently passing on failure (#2294)

PowerShell doesn't stop on non-zero exit codes by default. `go test`
failures were ignored, and the step reported success because the
subsequent caddy tests passed.

Caught on this job, which fails but is green:
https://github.com/php/frankenphp/actions/runs/23424633971/job/68136742625?pr=2287
This commit is contained in:
Nicolas Grekas
2026-03-23 07:49:18 +00:00
committed by GitHub
parent 33fcc4d5c0
commit 0a226ad129
2 changed files with 7 additions and 0 deletions

View File

@@ -229,6 +229,8 @@ jobs:
$env:PHPRC = Get-Location
go test -race ./...
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
cd caddy
go test -race ./...
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
working-directory: ${{ github.workspace }}\frankenphp

View File

@@ -23,6 +23,7 @@ import (
"os"
"os/exec"
"os/user"
"runtime"
"path/filepath"
"strconv"
"strings"
@@ -1315,6 +1316,10 @@ func testOpcachePreload(t *testing.T, opts *testOptions) {
t.Skip("This test is only supported in PHP 8.3 and above")
return
}
if runtime.GOOS == "windows" {
t.Skip("opcache.preload is not supported on Windows")
return
}
cwd, _ := os.Getwd()
preloadScript := cwd + "/testdata/preload.php"