Merge pull request #6868 from Crizz0/ticket/17539 #79
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Tests | |
| on: | |
| push: | |
| branches: | |
| - 3.3.x | |
| - master | |
| - 'prep-release-*' | |
| tags: | |
| - 'release-*' | |
| pull_request: | |
| branches: | |
| - 3.3.x | |
| - master | |
| - 'prep-release-*' | |
| jobs: | |
| # Basic checks, e.g. parse errors, commit messages, etc. | |
| basic-checks: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| include: | |
| - db: 'none' | |
| php: '8.1' | |
| NOTESTS: 1 | |
| name: PHP ${{ matrix.php }} - ${{ matrix.db }} | |
| steps: | |
| - name: Update Ubuntu package lists | |
| run: | | |
| sudo apt-get update -y --allow-releaseinfo-change | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 100 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: ${{ matrix.php }} | |
| extensions: dom, curl, libxml, mbstring, zip, pcntl, intl, gd, exif, iconv | |
| coverage: none | |
| - name: Get Composer Cache Directory | |
| id: composer-cache | |
| run: | | |
| cd phpBB | |
| echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | |
| cd .. | |
| - name: Cache Composer dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ steps.composer-cache.outputs.dir }} | |
| key: composer-${{ matrix.php }}-${{ hashFiles('phpBB/composer.lock') }} | |
| - name: Setup environment for phpBB | |
| env: | |
| DB: ${{ matrix.db }} | |
| PHP_VERSION: ${{ matrix.php }} | |
| NOTESTS: '1' | |
| run: | | |
| .github/setup-phpbb.sh $DB $PHP_VERSION $NOTESTS | |
| - name: Phing sniff | |
| run: | | |
| .github/phing-sniff.sh | |
| - name: Check doctum parse errors | |
| run: | | |
| .github/check-doctum-parse-errors.sh | |
| - name: Check code with psalm | |
| run: | | |
| phpBB/vendor/bin/psalm --output-format=github | |
| - name: Check image ICC profiles | |
| run: | | |
| .github/check-image-icc-profiles.sh | |
| - name: Check executable files | |
| run: | | |
| .github/check-executable-files.sh ./ | |
| - name: Check stylesheets | |
| run: | | |
| .github/check-stylesheet.sh | |
| - name: Lint JavaScript files | |
| run: | | |
| .github/check-js.sh | |
| - name: Check commit message | |
| if: github.event_name == 'pull_request' | |
| run: | | |
| git fetch origin $GITHUB_BASE_REF &> /dev/null | |
| git-tools/commit-msg-hook-range.sh $(git rev-parse origin/$GITHUB_BASE_REF)..$GITHUB_SHA | |
| # Tests for MySQL and MariaDB | |
| mysql-tests: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| include: | |
| - php: '8.1' | |
| db: "mariadb:10.2" | |
| - php: '8.1' | |
| db: "mariadb:10.3" | |
| - php: '8.1' | |
| db: "mariadb:10.4" | |
| - php: '8.1' | |
| db: "mariadb:10.6" | |
| - php: '8.1' | |
| db: "mariadb:10.9" | |
| - php: '8.1' | |
| db: "mariadb:10.10" | |
| - php: '8.1' | |
| db: "mariadb:10.11" | |
| - php: '8.1' | |
| db: "mysql:5.7" | |
| db_alias: "MySQL Slow Tests" | |
| SLOWTESTS: 1 | |
| - php: '8.1' | |
| db: "mysql:5.7" | |
| db_alias: "MyISAM Tests" | |
| MYISAM: 1 | |
| - php: '8.1' | |
| db: "mysql:5.7" | |
| - php: '8.1' | |
| db: "mysql:8.0" | |
| - php: '8.1' | |
| db: "mysql:8.1" | |
| - php: '8.2' | |
| db: "mysql:8.0" | |
| - php: '8.2' | |
| db: "mariadb:10.2" | |
| - php: '8.3' | |
| db: "mysql:5.7" | |
| - php: '8.3' | |
| db: "mariadb:10.2" | |
| - php: '8.4' | |
| db: "mysql:8.0" | |
| - php: '8.4' | |
| db: "mariadb:10.3" | |
| - php: '8.5' | |
| db: "mysql:8.0" | |
| - php: '8.5' | |
| db: "mariadb:10.3" | |
| name: PHP ${{ matrix.php }} - ${{ matrix.db_alias != '' && matrix.db_alias || matrix.db }} | |
| services: | |
| mysql: | |
| image: ${{ matrix.db }} | |
| env: | |
| MYSQL_ALLOW_EMPTY_PASSWORD: yes | |
| MYSQL_DATABASE: phpbb_tests | |
| ports: | |
| - 3306:3306 | |
| options: >- | |
| --health-cmd="mysqladmin ping" | |
| --health-interval=10s | |
| --health-timeout=5s | |
| --health-retries=3 | |
| redis: | |
| image: redis | |
| options: >- | |
| --health-cmd "redis-cli ping" | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| ports: | |
| - 6379:6379 | |
| steps: | |
| - name: Update Ubuntu package lists | |
| run: | | |
| sudo apt-get update -y --allow-releaseinfo-change | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - id: database-type | |
| env: | |
| MATRIX_DB: ${{ matrix.db }} | |
| run: | | |
| db=$(echo "${MATRIX_DB%%:*}") | |
| echo "db=$db" >> $GITHUB_OUTPUT | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: ${{ matrix.php }} | |
| extensions: dom, curl, libxml, mbstring, zip, pcntl, intl, gd, exif, iconv, mysqli, pdo, pdo_mysql, ldap | |
| coverage: none | |
| - name: Get Composer Cache Directory | |
| id: composer-cache | |
| env: | |
| PHP_VERSION: ${{ matrix.php }} | |
| run: | | |
| cd phpBB | |
| echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | |
| cd .. | |
| - name: Cache Composer dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ steps.composer-cache.outputs.dir }} | |
| key: composer-${{ matrix.php }}-${{ hashFiles('phpBB/composer.lock') }} | |
| - name: Setup environment for phpBB | |
| env: | |
| DB: ${{steps.database-type.outputs.db}} | |
| PHP_VERSION: ${{ matrix.php }} | |
| NOTESTS: '0' | |
| run: | | |
| .github/setup-phpbb.sh $DB $PHP_VERSION ${NOTESTS:-0} | |
| - name: Setup database | |
| env: | |
| DB: ${{steps.database-type.outputs.db}} | |
| MYISAM: ${{ matrix.MYISAM != 1 && '0' || '1' }} | |
| run: | | |
| .github/setup-database.sh $DB $MYISAM | |
| - name: Setup LDAP | |
| if: ${{ matrix.SLOWTESTS == 1 }} | |
| run: | | |
| .github/setup-ldap.sh | |
| - name: Setup node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - name: Setup node dependencies | |
| run: npm ci | |
| - name: Setup SPHINX | |
| run: | | |
| .github/setup-sphinx.sh | |
| - name: Lint tests | |
| if: ${{ matrix.SLOWTESTS != 1 && steps.database-type.outputs.db == 'mysql' }} | |
| run: phpBB/vendor/bin/phpunit tests/lint_test.php | |
| - name: Run unit tests | |
| env: | |
| DB: ${{steps.database-type.outputs.db}} | |
| if: ${{ matrix.SLOWTESTS != 1 && matrix.NOTESTS != 1 }} | |
| run: | | |
| phpBB/vendor/bin/phpunit --configuration .github/phpunit-$DB-github.xml --display-all-issues --stop-on-error | |
| - name: Slow tests | |
| env: | |
| DB: ${{steps.database-type.outputs.db}} | |
| if: ${{ matrix.SLOWTESTS == 1 }} | |
| run: | | |
| phpBB/vendor/bin/phpunit --configuration .github/phpunit-$DB-github.xml --group slow | |
| # Tests for PostgreSQL | |
| postgres-tests: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| include: | |
| - php: '8.1' | |
| db: "postgres:9.5" | |
| - php: '8.1' | |
| db: "postgres:9.6" | |
| - php: '8.1' | |
| db: "postgres:10" | |
| - php: '8.1' | |
| db: "postgres:11" | |
| - php: '8.1' | |
| db: "postgres:12" | |
| - php: '8.1' | |
| db: "postgres:13" | |
| - php: '8.1' | |
| db: "postgres:14" | |
| - php: '8.1' | |
| db: "postgres:15" | |
| - php: '8.2' | |
| db: "postgres:9.5" | |
| - php: '8.3' | |
| db: "postgres:9.5" | |
| - php: '8.4' | |
| db: "postgres:9.5" | |
| - php: '8.5' | |
| db: "postgres:9.5" | |
| name: PHP ${{ matrix.php }} - ${{ matrix.db }} | |
| services: | |
| postgres: | |
| image: ${{ matrix.db != 'postgres:9.5' && matrix.db != 'postgres:9.6' && matrix.db != 'postgres:10' && matrix.db != 'postgres:11' && matrix.db != 'postgres:12' && matrix.db != 'postgres:13' && matrix.db != 'postgres:14' && matrix.db != 'postgres:15' && 'postgres:10' || matrix.db }} | |
| env: | |
| POSTGRES_HOST: localhost | |
| POSTGRES_USER: postgres | |
| POSTGRES_PASSWORD: postgres | |
| ports: | |
| - 5432:5432 | |
| options: >- | |
| -v /var/run/postgresql:/var/run/postgresql | |
| --health-cmd pg_isready | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| redis: | |
| image: redis | |
| options: >- | |
| --health-cmd "redis-cli ping" | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| ports: | |
| - 6379:6379 | |
| steps: | |
| - name: Update Ubuntu package lists | |
| run: | | |
| sudo apt-get update -y --allow-releaseinfo-change | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - id: database-type | |
| env: | |
| MATRIX_DB: ${{ matrix.db }} | |
| run: | | |
| db=$(echo "${MATRIX_DB%%:*}") | |
| echo "db=$db" >> $GITHUB_OUTPUT | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: ${{ matrix.php }} | |
| extensions: dom, curl, libxml, mbstring, zip, pcntl, intl, gd, exif, iconv, pgsql, pdo, pdo_pgsql | |
| coverage: none | |
| - name: Get Composer Cache Directory | |
| id: composer-cache | |
| env: | |
| PHP_VERSION: ${{ matrix.php }} | |
| run: | | |
| cd phpBB | |
| echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | |
| cd .. | |
| - name: Cache Composer dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ steps.composer-cache.outputs.dir }} | |
| key: composer-${{ matrix.php }}-${{ hashFiles('phpBB/composer.lock') }} | |
| - name: Setup environment for phpBB | |
| env: | |
| DB: ${{steps.database-type.outputs.db}} | |
| PHP_VERSION: ${{ matrix.php }} | |
| NOTESTS: '0' | |
| run: | | |
| .github/setup-phpbb.sh $DB $PHP_VERSION ${NOTESTS:-0} | |
| - name: Setup database | |
| env: | |
| DB: ${{steps.database-type.outputs.db}} | |
| MYISAM: '0' | |
| run: | | |
| .github/setup-database.sh $DB $MYISAM | |
| - name: Setup node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - name: Setup node dependencies | |
| run: npm ci | |
| - name: Run unit tests | |
| env: | |
| DB: ${{steps.database-type.outputs.db}} | |
| run: | | |
| phpBB/vendor/bin/phpunit --configuration .github/phpunit-$DB-github.xml --display-all-issues --stop-on-error | |
| # Other database types, namely sqlite3 and mssql | |
| other-tests: | |
| runs-on: ubuntu-22.04 | |
| strategy: | |
| matrix: | |
| include: | |
| - php: '8.1' | |
| db: "sqlite3" | |
| - php: '8.1' | |
| db: "mcr.microsoft.com/mssql/server:2019-CU27-ubuntu-20.04" | |
| db_alias: 'MSSQL 2019' | |
| - php: '8.1' | |
| db: "mcr.microsoft.com/mssql/server:2022-CU13-ubuntu-22.04" | |
| db_alias: 'MSSQL 2022' | |
| name: PHP ${{ matrix.php }} - ${{ matrix.db_alias != '' && matrix.db_alias || matrix.db }} | |
| services: | |
| mssql: | |
| image: ${{ matrix.db != 'mcr.microsoft.com/mssql/server:2019-CU27-ubuntu-20.04' && matrix.db != 'mcr.microsoft.com/mssql/server:2022-CU13-ubuntu-22.04' && 'mcr.microsoft.com/mssql/server:2022-CU13-ubuntu-22.04' || matrix.db }} | |
| env: | |
| SA_PASSWORD: "Pssw0rd_12" | |
| ACCEPT_EULA: "y" | |
| ports: | |
| - 1433:1433 | |
| options: >- | |
| --health-cmd="/opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P 'Pssw0rd_12' -Q \"Use [master]; CREATE DATABASE [phpbb_tests] COLLATE Latin1_General_CI_AS\" || exit 1" | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| --health-start-period 10s | |
| redis: | |
| image: redis | |
| options: >- | |
| --health-cmd "redis-cli ping" | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| ports: | |
| - 6379:6379 | |
| steps: | |
| - name: Update Ubuntu package lists | |
| run: | | |
| sudo apt-get update -y --allow-releaseinfo-change | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - id: database-type | |
| env: | |
| MATRIX_DB: ${{ matrix.db }} | |
| run: | | |
| if [ $MATRIX_DB == 'mcr.microsoft.com/mssql/server:2019-CU27-ubuntu-20.04' ] || [ $MATRIX_DB == 'mcr.microsoft.com/mssql/server:2022-CU13-ubuntu-22.04' ] | |
| then | |
| db='mssql' | |
| else | |
| db=$(echo "${MATRIX_DB%%:*}") | |
| fi | |
| echo "db=$db" >> $GITHUB_OUTPUT | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: ${{ matrix.php }} | |
| extensions: dom, curl, libxml, mbstring, zip, pcntl, intl, gd, exif, iconv, sqlsrv, pdo, pdo_sqlsrv | |
| coverage: none | |
| - name: Get Composer Cache Directory | |
| id: composer-cache | |
| env: | |
| PHP_VERSION: ${{ matrix.php }} | |
| run: | | |
| cd phpBB | |
| echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | |
| cd .. | |
| - name: Cache Composer dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ steps.composer-cache.outputs.dir }} | |
| key: composer-${{ matrix.php }}-${{ hashFiles('phpBB/composer.lock') }} | |
| - name: Setup environment for phpBB | |
| env: | |
| DB: ${{steps.database-type.outputs.db}} | |
| PHP_VERSION: ${{ matrix.php }} | |
| NOTESTS: '0' | |
| run: | | |
| .github/setup-phpbb.sh $DB $PHP_VERSION ${NOTESTS:-0} | |
| - name: Setup database | |
| env: | |
| DB: ${{steps.database-type.outputs.db}} | |
| MYISAM: '0' | |
| run: | | |
| .github/setup-database.sh $DB $MYISAM | |
| - name: Setup node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - name: Setup node dependencies | |
| run: npm ci | |
| - name: Run unit tests | |
| env: | |
| DB: ${{steps.database-type.outputs.db}} | |
| run: | | |
| phpBB/vendor/bin/phpunit --configuration .github/phpunit-$DB-github.xml --display-all-issues --stop-on-error | |
| # Test with IIS & PostgreSQL on Windows | |
| windows-tests: | |
| runs-on: windows-2025 | |
| strategy: | |
| matrix: | |
| type: ['unit', 'functional'] | |
| php: ['8.4'] | |
| db: ['postgres'] | |
| name: Windows - ${{ matrix.type }} - PHP ${{ matrix.php }} - ${{ matrix.db }} | |
| steps: | |
| - name: Prepare git for Windows | |
| run: | | |
| git config --system core.autocrlf false | |
| git config --system core.eol lf | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: ${{ matrix.php }} | |
| extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, intl, gd, exif, iconv, pgsql, pdo_pgsql, sodium, bz2, fileinfo | |
| ini-values: upload_tmp_dir=${{ runner.temp }}, sys_temp_dir=${{ runner.temp }} | |
| coverage: none | |
| - name: Get Composer Cache Directory | |
| id: composer-cache | |
| run: | | |
| cd phpBB | |
| echo "dir=$(composer config cache-files-dir)" >> $env:GITHUB_OUTPUT | |
| cd .. | |
| - name: Cache Composer dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ steps.composer-cache.outputs.dir }} | |
| key: composer-${{ matrix.php }}-${{ hashFiles('phpBB/composer.lock') }} | |
| - name: Setup environment for phpBB | |
| env: | |
| GITHUB_WORKSPACE: ${{ github.workspace }} | |
| TEMP_DIR: ${{ runner.temp }} | |
| run: | | |
| # Disable Windows Defender real-time monitoring early to improve performance | |
| Set-MpPreference -DisableRealtimeMonitoring $true | |
| 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}\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 | |
| (Get-Content ${env:GITHUB_WORKSPACE}\phpBB\web.config).replace("`t</system.webServer>", "`t`t<httpErrors errorMode=`"Detailed`" />`n`t</system.webServer>") | Set-Content ${env:GITHUB_WORKSPACE}\phpBB\web.config | |
| choco install urlrewrite -y | |
| Import-Module WebAdministration | |
| New-WebSite -Name 'phpBBTest' -PhysicalPath "${env:GITHUB_WORKSPACE}\phpBB" -Force | |
| $session = Get-PSSession -Name WinPSCompatSession | |
| $sb = {Set-ItemProperty 'IIS:\Sites\phpBBTest' -name Bindings -value @{protocol='http';bindingInformation='*:80:phpbb.test'}} | |
| Invoke-Command -Scriptblock $sb -Session $session | |
| $sb = {Set-WebConfigurationProperty -filter /system.WebServer/security/authentication/AnonymousAuthentication -name enabled -value true -location "IIS:\Sites\phpBBTest"} | |
| Invoke-Command -Scriptblock $sb -Session $session | |
| Add-Content -Path $env:windir\System32\drivers\etc\hosts -Value "`r`n127.0.0.1`tphpbb.test" -Force | |
| [System.Environment]::SetEnvironmentVariable('PATH',$Env:PATH+";%windir%\system32\inetsrv") | |
| echo Setup FAST-CGI configuration | |
| Add-WebConfiguration -Filter /system.webServer/fastCgi -PSPath IIS:\ -Value @{fullpath="C:\tools\php\php-cgi.exe"} | |
| echo Setup FACT-CGI handler | |
| New-WebHandler -Name "PHP-FastCGI" -Path "*.php" -Modules FastCgiModule -ScriptProcessor "C:\tools\php\php-cgi.exe" -Verb '*' -ResourceType Either | |
| iisreset | |
| NET START W3SVC | |
| # Wait for IIS to be ready and test connectivity | |
| Start-Sleep -Seconds 10 | |
| try { | |
| $response = Invoke-WebRequest -Uri "http://phpbb.test/" -UseBasicParsing -TimeoutSec 30 | |
| Write-Host "Web server is responding: $($response.StatusCode)" | |
| } catch { | |
| Write-Host "Web server test failed: $_" | |
| } | |
| # Create directories and set permissions more efficiently | |
| $dirs = @("cache\test", "cache\installer") | |
| foreach ($dir in $dirs) { | |
| New-Item -Path "${env:GITHUB_WORKSPACE}\phpBB\$dir" -ItemType Directory -Force | |
| } | |
| # Set permissions in batch for better performance | |
| $paths = @("cache", "files", "store", "ext", "vendor-ext", "images\avatars\upload") | |
| foreach ($path in $paths) { | |
| if (Test-Path "${env:GITHUB_WORKSPACE}\phpBB\$path") { | |
| icacls "${env:GITHUB_WORKSPACE}\phpBB\$path" /grant Users:F /T /Q | |
| } | |
| } | |
| # Set permissions for specific files | |
| $files = @("composer-ext.json", "composer-ext.lock") | |
| foreach ($file in $files) { | |
| if (Test-Path "${env:GITHUB_WORKSPACE}\phpBB\$file") { | |
| icacls "${env:GITHUB_WORKSPACE}\phpBB\$file" /grant Users:F /Q | |
| } | |
| } | |
| $accessRule = New-Object System.Security.AccessControl.FileSystemAccessRule("IIS_IUSRS", "FullControl", "ContainerInherit,ObjectInherit", "None", "Allow") | |
| $acl = Get-ACL "${env:TEMP_DIR}" | |
| $acl.AddAccessRule($accessRule) | |
| Set-ACL -Path "${env:TEMP_DIR}" -ACLObject $acl | |
| cd ${env:GITHUB_WORKSPACE}\phpBB | |
| php ..\composer.phar install | |
| cd .. | |
| - name: Setup database | |
| run: | | |
| $postgreSqlSvc = Get-Service "postgresql*" | |
| Set-Service $postgreSqlSvc.Name -StartupType manual | |
| $runningStatus = [System.ServiceProcess.ServiceControllerStatus]::Running | |
| $maxStartTimeout = New-TimeSpan -Seconds 120 | |
| try { | |
| $postgreSqlSvc.Start() | |
| $postgreSqlSvc.WaitForStatus($runningStatus, $maxStartTimeout) | |
| } catch { | |
| $_ | select * | |
| } | |
| [System.Environment]::SetEnvironmentVariable('PATH',$Env:PATH+";${env:PGBIN}") | |
| $env:PGPASSWORD = 'root' | |
| # Optimize PostgreSQL for testing performance | |
| psql -c "ALTER SYSTEM SET fsync = off;" -U postgres | |
| psql -c "ALTER SYSTEM SET synchronous_commit = off;" -U postgres | |
| psql -c "ALTER SYSTEM SET checkpoint_completion_target = 0.9;" -U postgres | |
| psql -c "ALTER SYSTEM SET wal_buffers = '16MB';" -U postgres | |
| psql -c "ALTER SYSTEM SET shared_buffers = '128MB';" -U postgres | |
| psql -c 'DROP DATABASE IF EXISTS phpbb_tests;' -U postgres | |
| psql -c 'create database phpbb_tests;' -U postgres | |
| Set-MpPreference -ExclusionPath "${env:PGDATA}" # Exclude PGDATA directory from Windows Defender | |
| - name: Setup node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - name: Setup node dependencies | |
| run: npm ci | |
| - name: Run unit tests | |
| if: ${{ matrix.type == 'unit' }} | |
| run: | | |
| phpBB/vendor/bin/phpunit --configuration .github/phpunit-psql-windows-github.xml --display-all-issues --stop-on-error --exclude-group functional,slow | |
| - name: Run functional tests | |
| if: ${{ matrix.type == 'functional' }} | |
| timeout-minutes: 45 | |
| env: | |
| PHPBB_FUNCTIONAL_TIMEOUT: 30 | |
| SYMFONY_DEPRECATIONS_HELPER: disabled | |
| PHPBB_TEST_REDIS_HOST: '' | |
| PHPBB_TEST_MEMCACHED_HOST: '' | |
| run: | | |
| phpBB/vendor/bin/phpunit --configuration .github/phpunit-psql-windows-github.xml --display-all-issues --stop-on-error --group functional |