Fixes #60
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: Tests | |
on: [ push ] | |
jobs: | |
tests: | |
name: PHPUnit PHP ${{ matrix.php }} Postgres ${{ matrix.database }} (Symfony ${{ matrix.symfony }}) | |
runs-on: ubuntu-22.04 | |
strategy: | |
matrix: | |
php: | |
- '8.1' | |
- '8.2' | |
symfony: | |
- '6.3.*' | |
- '5.4.*' | |
database: | |
- 14 | |
- 15 | |
- 16 | |
- 13 | |
fail-fast: false | |
services: | |
postgres: | |
image: postgres:${{ matrix.database }} | |
env: | |
POSTGRES_DB: app | |
POSTGRES_PASSWORD: ChangeMe | |
POSTGRES_USER: symfony | |
# Set health checks to wait until postgres has started | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
ports: | |
- 5432:5432 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php }} | |
extensions: pcov | |
tools: flex | |
- name: Configure Symfony | |
run: composer config extra.symfony.require "${{ matrix.symfony }}" | |
- name: Get Composer Cache Directory | |
id: composer-cache | |
run: echo "::set-output name=dir::$(composer config cache-files-dir)" | |
- name: Cache dependencies | |
uses: actions/cache@v2 | |
with: | |
path: ${{ steps.composer-cache.outputs.dir }} | |
key: ${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }} | |
restore-keys: ${{ matrix.php }}-composer- | |
- name: Update project dependencies | |
run: composer update --no-progress --ansi --prefer-stable | |
- name: Validate composer | |
run: composer validate --strict --no-check-lock | |
- name: Run tests | |
run: vendor/bin/phpunit | |
env: | |
DB_DRIVER: pdo_pgsql | |
DB_HOST: localhost | |
DB_PORT: 5432 | |
DB_NAME: app | |
DB_USER: symfony | |
DB_PASSWORD: ChangeMe | |
DB_VERSION: ${{ matrix.database }} |