Skip to content

Add support for setting table connection name #18

Add support for setting table connection name

Add support for setting table connection name #18

Workflow file for this run

name: CI
on:
push:
pull_request:
workflow_dispatch:
jobs:
tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php-version: ['8.3', '8.5']
db-type: [sqlite, mysql, pgsql]
composer-type: [lowest, stable, dev]
name: Tests - PHP ${{ matrix.php-version }} & ${{ matrix.db-type }} & ${{ matrix.composer-type }}
services:
postgres:
image: postgres
ports:
- 5432:5432
env:
POSTGRES_DB: test_fixture_factories
POSTGRES_PASSWORD: root
POSTGRES_USER: root
steps:
- uses: actions/checkout@v5
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: mbstring, intl, apcu, pdo_${{ matrix.db-type }}
ini-values: apc.enable_cli = 1
coverage: pcov
- name: Update composer
run: composer self-update --snapshot
- name: Validate composer.json
run: composer validate
- name: Install dependencies
run: |
if [[ ${{ matrix.composer-type }} == 'lowest' ]]; then
composer update --prefer-dist --no-progress --no-suggest --prefer-stable --prefer-lowest
elif [[ ${{ matrix.composer-type }} == 'stable' ]]; then
composer update --prefer-dist --no-progress --no-suggest --prefer-stable
else
composer update --prefer-dist --no-progress --no-suggest
fi
- name: Run tests
run: |
if [ ${{ matrix.db-type }} == 'mysql' ]; then
sudo service mysql start && mysql -h 127.0.0.1 -u root -proot -e 'CREATE DATABASE IF NOT EXISTS test_fixture_factories;';
fi
if [[ '${{ matrix.php-version }}' == '8.3' && '${{ matrix.composer-type }}' == 'stable' ]]; then
composer ${{ matrix.db-type }} -- --with-coverage
else
composer ${{ matrix.db-type }}
fi
- name: Upload coverage reports to Codecov
if: success() && matrix.php-version == '8.3'
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
checks:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php-version: ['8.3']
name: PHPStan / Code Standards - PHP ${{ matrix.php-version }}
steps:
- uses: actions/checkout@v5
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: mbstring, intl, apcu
ini-values: apc.enable_cli = 1
- name: Update composer
run: composer self-update
- name: Validate composer.json
run: composer validate
- name: Install dependencies
run: composer update --prefer-dist --no-progress --no-suggest --prefer-stable
- name: Bake factories to perform analysis in the following steps
run: vendor/bin/phpunit tests/TestCase/Command/BakeFixtureFactoryCommandTest.php
- name: Run phpstan
run: composer stan
- name: Run phpcs
run: composer cs-check