Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 0 additions & 1 deletion .cbmignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ tests/
phpunit.xml
phpunit.xml.dist
phpunit.xml.dist.bak
webroot/
workspace/

# junk / backups from previous refactors (do not index)
Expand Down
4 changes: 1 addition & 3 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,11 @@
.gitattributes export-ignore
.gitignore export-ignore
.stickler.yml export-ignore
.travis.yml export-ignore
CONTRIBUTING.md export-ignore
Dockerfile export-ignore
docs.Dockerfile export-ignore
phpcs.xml.dist export-ignore
phpcs.xml export-ignore
phpstan.neon export-ignore
phpunit.xml.dist export-ignore
psalm.xml export-ignore
/.github export-ignore
/tests export-ignore
137 changes: 74 additions & 63 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ on:
branches:
- '*'

permissions:
contents: read # to fetch code (actions/checkout)

jobs:
testsuite:
runs-on: ubuntu-24.04
Expand All @@ -15,98 +18,106 @@ jobs:
matrix:
php-version: ['8.3', '8.4', '8.5']
db-type: [sqlite, mysql, pgsql]
prefer-lowest: ['']
dependencies: [highest]
include:
- php-version: '8.3'
db-type: sqlite
dependencies: lowest

services:
mysql:
image: ${{ matrix.db-type == 'mysql' && 'mysql:8.4' || '' }}
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: cakephp
ports:
- 3306:3306
options: >-
--health-cmd="mysqladmin ping -h 127.0.0.1 -proot"
--health-interval=5s
--health-timeout=5s
--health-retries=20
postgres:
image: ${{ matrix.db-type == 'pgsql' && 'postgres:18' || '' }}
env:
POSTGRES_PASSWORD: postgres
POSTGRES_DB: cakephp
ports:
- 5432:5432
options: >-
--health-cmd="pg_isready -U postgres"
--health-interval=5s
--health-timeout=5s
--health-retries=20

steps:
- name: Setup MySQL latest
if: matrix.db-type == 'mysql'
run: docker run --rm --name=mysqld -e MYSQL_ROOT_PASSWORD=root -e MYSQL_DATABASE=cakephp -p 3306:3306 -d mysql --default-authentication-plugin=mysql_native_password --disable-log-bin

- 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: actions/checkout@v4
- 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, sqlite, pdo_sqlite, pdo_${{ matrix.db-type }}, ${{ matrix.db-type }}
ini-values: apc.enable_cli = 1
coverage: pcov

- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Get date part for cache key
id: key-date
run: echo "::set-output name=date::$(date +'%Y-%m')"

- name: Cache composer dependencies
uses: actions/cache@v4
extensions: mbstring, intl, apcu, pdo_sqlite, pdo_${{ matrix.db-type }}
ini-values: apc.enable_cli = 1, zend.assertions = 1
coverage: ${{ (matrix.php-version == '8.3' && matrix.db-type == 'mysql') && 'pcov' || 'none' }}

- name: Composer install
uses: ramsey/composer-install@v3
env:
# test the declared floors: Composer's advisory blocking would silently raise them
COMPOSER_NO_SECURITY_BLOCKING: ${{ matrix.dependencies == 'lowest' && '1' || '0' }}
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ steps.key-date.outputs.date }}-${{ hashFiles('composer.json') }}-${{ matrix.prefer-lowest }}

- name: composer install
run: |
if ${{ matrix.prefer-lowest == 'prefer-lowest' }}; then
composer update --prefer-lowest --prefer-stable
else
composer update
fi

- name: Setup problem matchers for PHPUnit
if: matrix.php-version == '8.3' && matrix.db-type == 'mysql'
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
dependency-versions: ${{ matrix.dependencies }}

- name: Run PHPUnit
run: |
if [[ ${{ matrix.db-type }} == 'sqlite' ]]; then export DB_URL='sqlite:///:memory:'; fi
if [[ ${{ matrix.db-type }} == 'mysql' ]]; then export DB_URL='mysql://root:root@127.0.0.1/cakephp?encoding=utf8'; fi
if [[ ${{ matrix.db-type }} == 'pgsql' ]]; then export DB_URL='postgres://postgres:postgres@127.0.0.1/postgres'; fi
if [[ ${{ matrix.php-version }} == '8.3' ]]; then
export CODECOVERAGE=1 && vendor/bin/phpunit --display-deprecations --display-incomplete --display-skipped --coverage-clover=coverage.xml
if [[ ${{ matrix.db-type }} == 'sqlite' ]]; then export db_dsn='sqlite:///:memory:'; fi
if [[ ${{ matrix.db-type }} == 'mysql' ]]; then export db_dsn='mysql://root:root@127.0.0.1/cakephp?encoding=utf8'; fi
if [[ ${{ matrix.db-type }} == 'pgsql' ]]; then export db_dsn='postgres://postgres:postgres@127.0.0.1/cakephp'; fi
FLAGS="--display-all-issues --fail-on-all-issues --do-not-fail-on-skipped --do-not-fail-on-incomplete"
if [[ ${{ matrix.php-version }} == '8.3' && ${{ matrix.db-type }} == 'mysql' ]]; then
export CODECOVERAGE=1 && vendor/bin/phpunit $FLAGS --coverage-clover=coverage.xml
else
vendor/bin/phpunit
vendor/bin/phpunit $FLAGS
fi

- name: Submit code coverage
if: matrix.php-version == '8.3'
if: success() && matrix.php-version == '8.3' && matrix.db-type == 'mysql'
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}

cs-stan:
name: Coding Standard & Static Analysis
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
with:
persist-credentials: false

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
extensions: mbstring, intl, apcu
coverage: none
tools: cs2pr

- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Composer install
uses: ramsey/composer-install@v3

- name: Get date part for cache key
id: key-date
run: echo "::set-output name=date::$(date +'%Y-%m')"

- name: Cache composer dependencies
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ steps.key-date.outputs.date }}-${{ hashFiles('composer.json') }}-cs-stan
- name: Run phpcs
if: ${{ !cancelled() }}
shell: bash
run: vendor/bin/phpcs --report=checkstyle | cs2pr

- name: composer install
run: composer install --prefer-dist --no-progress
- name: Run phpstan
if: ${{ !cancelled() }}
run: vendor/bin/phpstan analyse src/ --error-format=github

- name: Run All Gates
run: composer check
- name: Run rector
if: ${{ !cancelled() }}
run: composer rector-check
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ vendor/
composer.lock
tmp
pmip
webroot/coverage
.php_cs.cache
.phpunit.cache/
.repowise
Expand Down
5 changes: 0 additions & 5 deletions .semver

This file was deleted.

59 changes: 0 additions & 59 deletions .travis.yml

This file was deleted.

Loading
Loading