Skip to content

Test Scrutinizer fix #163

Test Scrutinizer fix

Test Scrutinizer fix #163

Workflow file for this run

name: CI
on: [ push, pull_request ]
jobs:
tests:
runs-on: ubuntu-latest
strategy:
matrix:
php: [ 8.2, 8.1 ]
database: [ mysql, mariadb, pgsql, sqlite, singlestore ]
release: [ stable, lowest ]
include:
- database: mysql
pdo: mysql
- database: mariadb
pdo: mysql
- database: pgsql
pdo: pgsql
- database: sqlite
pdo: sqlite
- database: singlestore
pdo: singlestore
- php: 8.2
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
singlestore:
# check for new versions at https://github.com/singlestore-labs/singlestoredb-dev-image/pkgs/container/singlestoredb-dev/versions
image: ghcr.io/singlestore-labs/singlestoredb-dev:0.2.8
ports:
- 3306
env:
# this license key is only authorized for use in SingleStore laravel-cte tests and is heavily restricted
# if you want a free SingleStore license for your own use please visit https://www.singlestore.com/cloud-trial/
SINGLESTORE_LICENSE: BDMwMzMyOTEyNjMwYzQ1ODE5MDdjNThiYjU1MGM5YTAyAAAAAAAAAAAEAAAAAAAAAAwwNQIZAKqnuBG9UX3K2enIHyshQGHZIjQiCZpqlwIYE8t4J8VewDLm2m4+4i8KorAIZsJd8j6EAA==
ROOT_PASSWORD: "test"
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: mysql -h 127.0.0.1 -u root -ptest -P ${{ job.services.singlestore.ports[3306] }} -e "create database test"
if: matrix.database == 'singlestore'
- run: composer update --no-interaction --no-progress --prefer-dist --prefer-${{ matrix.release }} --ignore-platform-req=ext-oci8
- 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] }}
SINGLESTORE_PORT: ${{ job.services.singlestore.ports[3306] }}
- run: php tests/coverage/scrutinizer.php
if: matrix.coverage == 'xdebug'