Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 27 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -696,9 +696,33 @@ jobs:
run: |
Enable-WindowsOptionalFeature -Online -FeatureName IIS-WebServerRole, IIS-WebServer, IIS-CommonHttpFeatures, IIS-ManagementConsole, IIS-HttpErrors, IIS-HttpRedirect, IIS-WindowsAuthentication, IIS-StaticContent, IIS-DefaultDocument, IIS-HttpCompressionStatic, IIS-DirectoryBrowsing, IIS-WebServerManagementTools, IIS-CGI -All
Set-Service wuauserv -StartupType Manual
(Get-Content ${env:GITHUB_WORKSPACE}\phpBB3\phpBB\web.config).replace("<configuration>", "<configuration>`n`t<system.web>`n`t`t<customErrors mode=`"Off`"/>`n`t</system.web>") | Set-Content ${env:GITHUB_WORKSPACE}\phpBB3\phpBB\web.config
(Get-Content ${env:GITHUB_WORKSPACE}\phpBB3\phpBB\web.config).replace("`t</system.webServer>", "`t`t<httpErrors errorMode=`"Detailed`" />`n`t</system.webServer>") | Set-Content ${env:GITHUB_WORKSPACE}\phpBB3\phpBB\web.config
choco install urlrewrite -y
$webConfig = "${env:GITHUB_WORKSPACE}\phpBB3\phpBB\web.config"
# Install URL Rewrite with retries because Chocolatey feed requests can timeout on GitHub runners.
$installed = $false
for ($i = 1; $i -le 3; $i++) {
try {
choco install urlrewrite -y --no-progress
$installed = $true
break
} catch {
Write-Warning "URL Rewrite install attempt $i failed: $($_.Exception.Message)"
Start-Sleep -Seconds (10 * $i)
}
}
if (-not $installed) {
throw "Failed to install URL Rewrite after 3 attempts."
}
# Only patch web.config after rewrite is installed.
$content = Get-Content $webConfig -Raw
$content = $content.Replace(
"<configuration>",
"<configuration>`n`t<system.web>`n`t`t<customErrors mode=`"Off`"/>`n`t</system.web>"
)
$content = $content.Replace(
"`t</system.webServer>",
"`t`t<httpErrors errorMode=`"Detailed`" />`n`t</system.webServer>"
)
Set-Content $webConfig -Value $content -Encoding UTF8
Import-Module WebAdministration
New-WebSite -Name 'phpBBTest' -PhysicalPath "${env:GITHUB_WORKSPACE}\phpBB3\phpBB" -Force
$session = Get-PSSession -Name WinPSCompatSession
Expand Down