Laravel 11.x Compatibility (#402) #116
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: MySQL Tests | |
on: | |
- push | |
- pull_request | |
jobs: | |
laravel-tests: | |
runs-on: ubuntu-latest | |
services: | |
mysql: | |
image: mysql:8.0 | |
env: | |
MYSQL_ALLOW_EMPTY_PASSWORD: yes | |
MYSQL_DATABASE: db_test_laravel | |
ports: | |
- 33306:3306 | |
options: >- | |
--health-cmd="mysqladmin ping" | |
--health-interval=10s | |
--health-timeout=5s | |
--health-retries=3 | |
strategy: | |
fail-fast: false | |
matrix: | |
operating-system: [ubuntu-latest] | |
php-versions: ['8.1', '8.2', '8.3'] | |
dependency-stability: [prefer-stable] | |
laravel: ['9.*', '10.*', '11.*'] | |
include: | |
- laravel: 9.* | |
testbench: 7.* | |
- laravel: 10.* | |
testbench: 8.* | |
- laravel: 11.* | |
testbench: 9.* | |
exclude: | |
- laravel: 10.* | |
php-versions: 8.0 | |
- laravel: 11.* | |
php-versions: 8.1 | |
name: P${{ matrix.php-versions }} - L${{ matrix.laravel }} - ${{ matrix.dependency-stability }} - ${{ matrix.operating-system}} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install PHP versions | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php-versions }} | |
- name: Get Composer Cache Directory 2 | |
id: composer-cache | |
run: | | |
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | |
- uses: actions/cache@v4 | |
id: actions-cache | |
with: | |
path: ${{ steps.composer-cache.outputs.dir }} | |
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | |
restore-keys: | | |
${{ runner.os }}-composer- | |
- name: Install Laravel Dependencies | |
run: | | |
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update --dev | |
composer update --${{ matrix.dependency-stability }} --prefer-dist --no-interaction | |
- name: Execute tests (Unit and Feature tests) via PHPUnit | |
env: | |
DB_CONNECTION: mysql | |
DB_DATABASE: db_test_laravel | |
DB_PORT: 33306 | |
DB_USERNAME: root | |
run: vendor/bin/phpunit --testdox |