Skip to content

Tests

Tests #806

Workflow file for this run

name: Tests
on:
push:
branches:
- main
pull_request:
schedule:
- cron: '0 0 * * *'
jobs:
tests:
runs-on: ubuntu-latest
services:
mysql:
image: mysql:8.0.30
env:
MYSQL_ROOT_PASSWORD: "root_password"
MYSQL_DATABASE: "outbox_messages"
MYSQL_USER: "username"
MYSQL_PASSWORD: "password"
MYSQL_ROOT_HOST: "0.0.0.0"
ports:
- "3306:3306"
postgres:
image: postgres:14-alpine3.16
env:
POSTGRES_DB: "outbox_messages"
POSTGRES_USER: "username"
POSTGRES_PASSWORD: "password"
ports:
- "5432:5432"
strategy:
fail-fast: true
matrix:
php: [8.0, 8.1, 8.2]
eventsauce: ['^3.0']
stability: [prefer-lowest, prefer-stable]
name: PHP ${{ matrix.php }} - EventSauce ${{ matrix.eventsauce }} - ${{ matrix.stability }}
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip
coverage: none
- name: Install specific eventsauce version
run: |
composer require "eventsauce/eventsauce=${{ matrix.eventsauce }}" -w --prefer-dist --no-interaction --no-update
- name: Install specific doctrine version
run: |
composer require "doctrine/dbal:^3.1" -w --prefer-dist --no-interaction --no-update
- name: Install dependencies
run: composer update --${{ matrix.stability }} --prefer-dist --no-interaction --no-progress
- name: Setup database
run: php src/wait-for-and-setup-database.php
- name: Execute tests
run: vendor/bin/phpunit --exclude-group=doctrine2
- name: Run PHPStan
if: ${{ matrix.eventsauce == '3.0' }}
run: vendor/bin/phpstan analyze
- name: Install doctrine2
run: composer require doctrine/dbal:^2.6 --${{ matrix.stability }} -w --prefer-dist --no-interaction --no-progress
- name: Execute doctrine2 tests
run: vendor/bin/phpunit --group=doctrine2
- name: Install illuminate/database 9
run: composer require illuminate/database:^9.0 --${{ matrix.stability }} -w --prefer-dist --no-interaction --no-progress
- name: Execute illuminate tests
run: vendor/bin/phpunit --group=illuminate
- name: Install illuminate/database 10
if: ${{ matrix.php >= 8.1 }}
run: |
composer require illuminate/database:^10.0 --${{ matrix.stability }} -w --prefer-dist --no-interaction --no-progress --no-update
composer update --${{ matrix.stability }} --prefer-dist --no-interaction --no-progress
- name: Execute illuminate tests
if: ${{ matrix.php >= 8.1 }}
run: vendor/bin/phpunit --group=illuminate
- name: Run PHPStan
if: ${{ matrix.eventsauce == '3.0' }}
run: vendor/bin/phpstan analyze -c phpstan.doctrine2.neon