@@ -553,6 +553,9 @@ jobs:
553553 GITHUB_WORKSPACE : ${{ github.workspace }}
554554 TEMP_DIR : ${{ runner.temp }}
555555 run : |
556+ # Disable Windows Defender real-time monitoring early to improve performance
557+ Set-MpPreference -DisableRealtimeMonitoring $true
558+
556559 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
557560 Set-Service wuauserv -StartupType Manual
558561 (Get-Content ${env:GITHUB_WORKSPACE}\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}\phpBB\web.config
@@ -573,12 +576,38 @@ jobs:
573576 New-WebHandler -Name "PHP-FastCGI" -Path "*.php" -Modules FastCgiModule -ScriptProcessor "C:\tools\php\php-cgi.exe" -Verb '*' -ResourceType Either
574577 iisreset
575578 NET START W3SVC
576- mkdir "${env:GITHUB_WORKSPACE}\phpBB\cache\test"
577- mkdir "${env:GITHUB_WORKSPACE}\phpBB\cache\installer"
578- icacls "${env:GITHUB_WORKSPACE}\phpBB\cache" /grant Users:F /T
579- icacls "${env:GITHUB_WORKSPACE}\phpBB\files" /grant Users:F /T
580- icacls "${env:GITHUB_WORKSPACE}\phpBB\store" /grant Users:F /T
581- icacls "${env:GITHUB_WORKSPACE}\phpBB\images\avatars\upload" /grant Users:F /T
579+
580+ # Wait for IIS to be ready and test connectivity
581+ Start-Sleep -Seconds 10
582+ try {
583+ $response = Invoke-WebRequest -Uri "http://phpbb.test/" -UseBasicParsing -TimeoutSec 30
584+ Write-Host "Web server is responding: $($response.StatusCode)"
585+ } catch {
586+ Write-Host "Web server test failed: $_"
587+ }
588+
589+ # Create directories and set permissions more efficiently
590+ $dirs = @("cache\test", "cache\installer")
591+ foreach ($dir in $dirs) {
592+ New-Item -Path "${env:GITHUB_WORKSPACE}\phpBB\$dir" -ItemType Directory -Force
593+ }
594+
595+ # Set permissions in batch for better performance
596+ $paths = @("cache", "files", "store", "ext", "vendor-ext", "images\avatars\upload")
597+ foreach ($path in $paths) {
598+ if (Test-Path "${env:GITHUB_WORKSPACE}\phpBB\$path") {
599+ icacls "${env:GITHUB_WORKSPACE}\phpBB\$path" /grant Users:F /T /Q
600+ }
601+ }
602+
603+ # Set permissions for specific files
604+ $files = @("composer-ext.json", "composer-ext.lock")
605+ foreach ($file in $files) {
606+ if (Test-Path "${env:GITHUB_WORKSPACE}\phpBB\$file") {
607+ icacls "${env:GITHUB_WORKSPACE}\phpBB\$file" /grant Users:F /Q
608+ }
609+ }
610+
582611 $accessRule = New-Object System.Security.AccessControl.FileSystemAccessRule("IIS_IUSRS", "FullControl", "ContainerInherit,ObjectInherit", "None", "Allow")
583612 $acl = Get-ACL "${env:TEMP_DIR}"
584613 $acl.AddAccessRule($accessRule)
@@ -593,7 +622,7 @@ jobs:
593622 $postgreSqlSvc = Get-Service "postgresql*"
594623 Set-Service $postgreSqlSvc.Name -StartupType manual
595624 $runningStatus = [System.ServiceProcess.ServiceControllerStatus]::Running
596- $maxStartTimeout = New-TimeSpan -Seconds 30
625+ $maxStartTimeout = New-TimeSpan -Seconds 120
597626 try {
598627 $postgreSqlSvc.Start()
599628 $postgreSqlSvc.WaitForStatus($runningStatus, $maxStartTimeout)
@@ -602,17 +631,28 @@ jobs:
602631 }
603632 [System.Environment]::SetEnvironmentVariable('PATH',$Env:PATH+";${env:PGBIN}")
604633 $env:PGPASSWORD = 'root'
605- psql -c 'ALTER SYSTEM SET hot_standby = on;' -U postgres
606- psql -c 'ALTER SYSTEM SET wal_level = minimal;' -U postgres
634+
635+ # Optimize PostgreSQL for testing performance
636+ psql -c "ALTER SYSTEM SET fsync = off;" -U postgres
637+ psql -c "ALTER SYSTEM SET synchronous_commit = off;" -U postgres
638+ psql -c "ALTER SYSTEM SET checkpoint_completion_target = 0.9;" -U postgres
639+ psql -c "ALTER SYSTEM SET wal_buffers = '16MB';" -U postgres
640+ psql -c "ALTER SYSTEM SET shared_buffers = '128MB';" -U postgres
607641 psql -c 'DROP DATABASE IF EXISTS phpbb_tests;' -U postgres
608642 psql -c 'create database phpbb_tests;' -U postgres
643+
609644 Set-MpPreference -ExclusionPath "${env:PGDATA}" # Exclude PGDATA directory from Windows Defender
610- Set-MpPreference -DisableRealtimeMonitoring $true
611645 - name : Run unit tests
612646 if : ${{ matrix.type == 'unit' }}
613647 run : |
614648 phpBB/vendor/bin/phpunit --configuration .github/phpunit-psql-windows-github.xml --verbose --stop-on-error --exclude-group functional
615649 - name : Run unit tests
616650 if : ${{ matrix.type == 'functional' }}
651+ timeout-minutes : 45
652+ env :
653+ PHPBB_FUNCTIONAL_TIMEOUT : 30
654+ SYMFONY_DEPRECATIONS_HELPER : disabled
655+ PHPBB_TEST_REDIS_HOST : ' '
656+ PHPBB_TEST_MEMCACHED_HOST : ' '
617657 run : |
618658 phpBB/vendor/bin/phpunit --configuration .github/phpunit-psql-windows-github.xml --verbose --stop-on-error --group functional
0 commit comments