diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 5d2c75a..1b15a45 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -698,6 +698,7 @@ jobs: $httpErrors = $webConfigXml.CreateElement('httpErrors') $httpErrors.SetAttribute('errorMode', 'Detailed') [void]$systemWebServer.AppendChild($httpErrors) + $appCmd = Join-Path $env:windir 'System32\inetsrv\appcmd.exe' $rewriteInstalled = $false try { choco install urlrewrite -y --no-progress @@ -705,6 +706,11 @@ jobs: if ($LASTEXITCODE -ne 0) { throw "Chocolatey URL Rewrite installation exited with code $LASTEXITCODE." } + # Chocolatey can report success even when its feed failed and no packages were installed. + $iisModules = @(& $appCmd list modules /text:MODULE.NAME) + if ($LASTEXITCODE -ne 0 -or $iisModules -notcontains 'RewriteModule') { + throw 'IIS URL Rewrite module is not registered after installation.' + } $rewriteInstalled = $true } catch { Write-Warning "URL Rewrite installation failed; continuing without rewrite-specific IIS configuration. $_" @@ -731,6 +737,11 @@ jobs: New-WebHandler -Name "PHP-FastCGI" -Path "*.php" -Modules FastCgiModule -ScriptProcessor "C:\tools\php\php-cgi.exe" -Verb '*' -ResourceType Either iisreset NET START W3SVC + $iisConfiguration = & $appCmd list config 'phpBBTest/' + if ($LASTEXITCODE -ne 0) { + Get-Content $webConfig + throw "IIS rejected the phpBB test site configuration: $iisConfiguration" + } mkdir "${env:GITHUB_WORKSPACE}\phpBB3\phpBB\cache\test" mkdir "${env:GITHUB_WORKSPACE}\phpBB3\phpBB\cache\installer" icacls "${env:GITHUB_WORKSPACE}\phpBB3\phpBB\cache" /grant Users:F /T