Skip to content

Some code refresh

Some code refresh #146

Workflow file for this run

name: Build with PostgreSQL
on:
pull_request:
push:
branches:
- "master"
jobs:
Tests:
name: PHP ${{ matrix.php }} + PostgreSQL ${{ matrix.pgsql }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: ['7.2', '7.3', '7.4', '8.0', '8.1']
pgsql: ['9', '10', '11', '12', '13', '14', '15']
services:
postgres:
image: postgres:${{ matrix.pgsql }}
env:
POSTGRES_USER: migration
POSTGRES_PASSWORD: password
POSTGRES_DB: migration
ports:
- 5432/tcp
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 3
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: mbstring, intl, pgsql
coverage: none
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
update: true
- name: Get composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache composer dependencies
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install dependencies
run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader
- name: Prepare DB connections for tests
run: printf "<?php\n\n\$config['pgsql']['dsn']='pgsql:host=127.0.0.1;port=${{ job.services.postgres.ports['5432'] }};dbname=postgres';\n" >> tests/config.local.php;
- name: PHPUnit tests
run: vendor/bin/phpunit --exclude-group mysql,sqlite,autoloader