Skip to content

Merge pull request #20 from clearbooks/mysql8-compatibility #16

Merge pull request #20 from clearbooks/mysql8-compatibility

Merge pull request #20 from clearbooks/mysql8-compatibility #16

Workflow file for this run

name: Tests
on: [push, pull_request]
jobs:
run:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: ['7.4', '8.2', '8.3']
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
coverage: xdebug
- name: Setup MySQL
uses: shogo82148/actions-setup-mysql@v1
with:
mysql-version: '8.0'
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v2
with:
path: vendor
key: ${{ runner.os }}-php-${{ matrix.php-versions }}-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-${{ matrix.php-versions }}-
- name: Install dependencies
run: composer install -o --no-progress
- name: Set up database
run: |
cp config/db-config.sample.php config/db-config.php
mysql -uroot -h127.0.0.1 -e 'CREATE DATABASE labs;'
cat vendor/clearbooks/labs-schema/sql/*.sql | mysql -uroot -h127.0.0.1 labs
- name: Run tests
run: ./vendor/bin/phpunit -c phpunit.xml