Paginator sortMap. #13688
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: CI | |
on: | |
push: | |
branches: | |
- '4.x' | |
- '4.next' | |
- '5.x' | |
- '5.next' | |
pull_request: | |
branches: | |
- '*' | |
workflow_dispatch: | |
permissions: | |
contents: read # to fetch code (actions/checkout) | |
jobs: | |
testsuite: | |
runs-on: ubuntu-24.04 | |
strategy: | |
fail-fast: false | |
matrix: | |
php-version: ['8.2', '8.4'] | |
db-type: [sqlite, pgsql] | |
include: | |
- php-version: '8.2' | |
db-type: 'mariadb' | |
- php-version: '8.2' | |
db-type: 'mysql' | |
dependencies: 'lowest' | |
- php-version: '8.2' | |
db-type: 'mysql' | |
- php-version: '8.3' | |
db-type: 'mysql' | |
- php-version: '8.4' | |
db-type: 'mysql' | |
dependencies: highest | |
- php-version: '8.5' | |
db-type: 'sqlite' | |
dependencies: highest | |
composer-options: '--ignore-platform-req=php' | |
services: | |
redis: | |
image: redis | |
ports: | |
- 6379/tcp | |
memcached: | |
image: memcached | |
ports: | |
- 11211/tcp | |
redis-cluster: | |
image: grokzen/redis-cluster:6.2.1 | |
ports: | |
- 7000:7000 | |
- 7001:7001 | |
options: >- | |
--health-cmd "redis-cli -p 7000 ping" | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
steps: | |
- name: Setup MySQL 8.4 | |
if: matrix.db-type == 'mysql' && matrix.dependencies == 'highest' | |
run: docker run --rm --name=mysqld -e MYSQL_ROOT_PASSWORD=root -e MYSQL_DATABASE=cakephp -p 3306:3306 -d mysql:8.4 | |
- name: Setup MySQL 8.0 | |
if: matrix.db-type == 'mysql' && matrix.dependencies == '' | |
run: | | |
sudo service mysql start | |
mysql -h 127.0.0.1 -u root -proot -e 'CREATE DATABASE cakephp;' | |
- name: Setup MySQL 5.7 | |
if: matrix.db-type == 'mysql' && matrix.dependencies == 'lowest' | |
run: docker run --rm --name=mysqld -e MYSQL_ROOT_PASSWORD=root -e MYSQL_DATABASE=cakephp -p 3306:3306 -d mysql:5.7 --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci | |
- name: Setup PostgreSQL latest | |
if: matrix.db-type == 'pgsql' | |
run: docker run --rm --name=postgres -e POSTGRES_PASSWORD=postgres -e POSTGRES_DB=cakephp -p 5432:5432 -d postgres | |
- uses: getong/[email protected] | |
if: matrix.db-type == 'mariadb' | |
with: | |
mysql database: 'cakephp' | |
mysql root password: 'root' | |
- uses: actions/checkout@v5 | |
with: | |
persist-credentials: false | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php-version }} | |
extensions: mbstring, intl, apcu, memcached, redis, pdo_${{ matrix.db-type }} | |
ini-values: apc.enable_cli = 1, zend.assertions = 1 | |
coverage: pcov | |
- name: Install packages | |
run: | | |
sudo locale-gen da_DK.UTF-8 | |
sudo locale-gen de_DE.UTF-8 | |
- name: Composer install | |
uses: ramsey/composer-install@v3 | |
with: | |
dependency-versions: ${{ matrix.dependencies }} | |
composer-options: "${{ matrix.composer-options }}" | |
- name: Setup problem matchers for PHPUnit | |
if: matrix.php-version == '8.2' && matrix.db-type == 'mysql' | |
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" | |
- name: Run PHPUnit | |
env: | |
REDIS_PORT: ${{ job.services.redis.ports['6379'] }} | |
MEMCACHED_PORT: ${{ job.services.memcached.ports['11211'] }} | |
REDIS_CLUSTER_NODES: "127.0.0.1:7000,127.0.0.1:7001" | |
run: | | |
if [[ ${{ matrix.db-type }} == 'sqlite' ]]; then export DB_URL='sqlite:///:memory:'; fi | |
if [[ ${{ matrix.db-type }} == 'mysql' ]]; then export DB_URL='mysql://root:[email protected]/cakephp'; fi | |
if [[ ${{ matrix.db-type }} == 'mariadb' ]]; then export DB_URL='mysql://root:[email protected]/cakephp'; fi | |
if [[ ${{ matrix.db-type }} == 'pgsql' ]]; then export DB_URL='postgres://postgres:[email protected]/postgres'; fi | |
if [[ ${{ matrix.php-version }} == '8.2' ]]; then | |
export CODECOVERAGE=1 | |
vendor/bin/phpunit --display-warnings --display-incomplete --coverage-clover=coverage.xml | |
CAKE_TEST_AUTOQUOTE=1 vendor/bin/phpunit --display-deprecations --display-warnings --display-incomplete --testsuite=database | |
vendor/bin/phpunit --display-warnings --display-incomplete --testsuite=globalfunctions --coverage-clover=coverage-functions.xml | |
else | |
vendor/bin/phpunit --display-phpunit-deprecations --display-deprecations --display-warnings | |
CAKE_TEST_AUTOQUOTE=1 vendor/bin/phpunit --display-phpunit-deprecations --display-deprecations --display-warnings --testsuite=database | |
fi | |
- name: Submit code coverage | |
if: matrix.php-version == '8.2' | |
uses: codecov/codecov-action@v5 | |
with: | |
files: coverage.xml,coverage-functions.xml | |
token: ${{ secrets.CODECOV_TOKEN }} | |
testsuite-windows: | |
runs-on: windows-2022 | |
name: Windows - PHP 8.2 & SQL Server | |
env: | |
EXTENSIONS: mbstring, intl, apcu, redis, pdo_sqlsrv | |
PHP_VERSION: '8.2' | |
steps: | |
- uses: actions/checkout@v5 | |
with: | |
persist-credentials: false | |
- name: Get date part for cache key | |
id: key-date | |
run: echo "date=$(date +'%Y-%m')" >> $env:GITHUB_OUTPUT | |
- name: Setup PHP extensions cache | |
id: php-ext-cache | |
uses: shivammathur/cache-extensions@v1 | |
with: | |
php-version: ${{ env.PHP_VERSION }} | |
extensions: ${{ env.EXTENSIONS }} | |
key: ${{ steps.key-date.outputs.date }} | |
- name: Cache PHP extensions | |
uses: actions/cache@v4 | |
with: | |
path: ${{ steps.php-ext-cache.outputs.dir }} | |
key: ${{ runner.os }}-php-ext-${{ steps.php-ext-cache.outputs.key }} | |
restore-keys: ${{ runner.os }}-php-ext-${{ steps.php-ext-cache.outputs.key }} | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ env.PHP_VERSION }} | |
extensions: ${{ env.EXTENSIONS }} | |
ini-values: apc.enable_cli = 1, zend.assertions = 1, extension = php_fileinfo.dll | |
coverage: none | |
- name: Setup SQLServer | |
run: | | |
# MSSQLLocalDB is the default SQL LocalDB instance | |
SqlLocalDB start MSSQLLocalDB | |
SqlLocalDB info MSSQLLocalDB | |
sqlcmd -S "(localdb)\MSSQLLocalDB" -Q "create database cakephp;" | |
- name: Composer install | |
uses: ramsey/composer-install@v3 | |
- name: Run PHPUnit | |
env: | |
DB_URL: 'sqlserver://@(localdb)\MSSQLLocalDB/cakephp' | |
run: | | |
set CAKE_DISABLE_GLOBAL_FUNCS=1 | |
vendor/bin/phpunit --display-incomplete | |
- name: Run PHPUnit (autoquote enabled) | |
env: | |
DB_URL: 'sqlserver://@(localdb)\MSSQLLocalDB/cakephp' | |
run: | | |
set CAKE_TEST_AUTOQUOTE=1 | |
vendor/bin/phpunit --display-incomplete --testsuite=database | |
cs-stan: | |
name: Coding Standard & Static Analysis | |
runs-on: ubuntu-24.04 | |
env: | |
PHIVE_KEYS: 'CF1A108D0E7AE720,51C67305FFC2E5C0,12CE0F1D262429A5' | |
PHPSTAN_TESTS: 1 | |
steps: | |
- uses: actions/checkout@v5 | |
with: | |
persist-credentials: false | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: '8.2' | |
extensions: mbstring, intl | |
coverage: none | |
tools: phive, cs2pr | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Composer install | |
uses: ramsey/composer-install@v3 | |
- name: Install PHP tools with phive. | |
run: 'phive install --trust-gpg-keys "$PHIVE_KEYS"' | |
- name: Run phpcs | |
if: always() | |
run: vendor/bin/phpcs --report=checkstyle | cs2pr | |
- name: Run phpstan | |
if: always() | |
run: tools/phpstan analyse --error-format=github | |
- name: Run phpstan for tests | |
if: env.PHPSTAN_TESTS | |
run: tools/phpstan analyse -c tests/phpstan.neon --error-format=github | |
- name: Run class deprecation aliasing validation script | |
if: always() | |
run: php contrib/validate-deprecation-aliases.php | |
- name: Run composer.json validation for split packages | |
if: always() | |
run: php contrib/validate-split-packages.php | |
- name: Prefer lowest check | |
if: matrix.prefer-lowest == 'prefer-lowest' | |
run: composer require --dev dereuromark/composer-prefer-lowest && vendor/bin/validate-prefer-lowest -m | |
- name: Run rector | |
if: always() | |
run: composer rector-setup && composer rector-check | |
split-packages-stan: | |
name: Static Analysis for Split Packages | |
runs-on: ubuntu-24.04 | |
env: | |
PHIVE_KEYS: 'CF1A108D0E7AE720,51C67305FFC2E5C0,12CE0F1D262429A5' | |
steps: | |
- uses: actions/checkout@v5 | |
with: | |
persist-credentials: false | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: '8.2' | |
extensions: mbstring, intl | |
coverage: none | |
tools: phive | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Composer install | |
uses: ramsey/composer-install@v3 | |
- name: Install PHP tools with phive. | |
run: 'phive install --trust-gpg-keys "$PHIVE_KEYS"' | |
- name: Run phpstan for split packages | |
continue-on-error: true | |
run: php contrib/validate-split-packages-phpstan.php |