Add IDE helper model hook #161
Workflow file for this run
This file contains 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, pull_request ] | |
jobs: | |
tests: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
php: [ 8.3, 8.2, 8.1 ] | |
database: [ mysql, mariadb, pgsql, sqlite, sqlsrv ] | |
release: [ stable, lowest ] | |
include: | |
- database: mysql | |
pdo: mysql | |
- database: mariadb | |
pdo: mysql | |
- database: pgsql | |
pdo: pgsql | |
- database: sqlite | |
pdo: sqlite | |
- database: sqlsrv | |
pdo: sqlsrv | |
- php: 8.3 | |
release: stable | |
coverage: xdebug | |
services: | |
mysql: | |
image: mysql:latest | |
env: | |
MYSQL_ROOT_PASSWORD: password | |
MYSQL_DATABASE: test | |
ports: | |
- 3306 | |
mariadb: | |
image: mariadb:latest | |
env: | |
MYSQL_ROOT_PASSWORD: password | |
MYSQL_DATABASE: test | |
ports: | |
- 3306 | |
pgsql: | |
image: postgres:latest | |
env: | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: password | |
POSTGRES_DB: test | |
ports: | |
- 5432/tcp | |
sqlsrv: | |
image: mcr.microsoft.com/mssql/server:2019-latest | |
env: | |
ACCEPT_EULA: Y | |
SA_PASSWORD: Password! | |
options: >- | |
--name sqlsrv | |
--health-cmd "echo quit | /opt/mssql-tools/bin/sqlcmd -S 127.0.0.1 -l 1 -U sa -P Password!" | |
ports: | |
- 1433 | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 2 | |
- uses: actions/cache@v3 | |
with: | |
path: ~/.cache/composer/files | |
key: php-${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }} | |
- uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php }} | |
tools: pecl | |
extensions: bcmath, ctype, json, mbstring, openssl, pdo, pdo_${{ matrix.pdo }}, tokenizer, xml | |
coverage: ${{ matrix.coverage }} | |
- run: docker exec sqlsrv /opt/mssql-tools/bin/sqlcmd -S 127.0.0.1 -U sa -P Password! -Q "create database [test]" | |
if: matrix.database == 'sqlsrv' | |
- run: composer update --no-interaction --no-progress --prefer-dist --prefer-${{ matrix.release }} | |
- run: cp tests/config/database.ci.php tests/config/database.php | |
- run: | | |
PHPUNIT_FLAGS=$([ "${{ matrix.coverage }}" == "xdebug" ] && echo "--coverage-clover=coverage.xml" || echo "") | |
vendor/bin/phpunit $PHPUNIT_FLAGS | |
env: | |
DATABASE: ${{ matrix.database }} | |
MYSQL_PORT: ${{ job.services.mysql.ports[3306] }} | |
MARIADB_PORT: ${{ job.services.mariadb.ports[3306] }} | |
PGSQL_PORT: ${{ job.services.pgsql.ports[5432] }} | |
SQLSRV_PORT: ${{ job.services.sqlsrv.ports[1433] }} | |
- run: php tests/coverage/scrutinizer.php | |
if: matrix.coverage == 'xdebug' |