Add PHP 8.4 support and improve test coverage #147
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: run-tests | |
on: | |
push: | |
branches: [master] | |
pull_request: | |
branches: [master] | |
jobs: | |
test: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: true | |
matrix: | |
os: [ubuntu-latest, windows-latest] | |
stability: [prefer-lowest, prefer-stable] | |
php-laravel-testbench: | |
- {php: 8.0.2, laravel: ^9.47, testbench: 7.*} | |
- {php: 8.1, laravel: ^9.47, testbench: 7.*} | |
- {php: 8.2, laravel: ^9.47, testbench: 7.*} | |
- {php: 8.3, laravel: ^9.47, testbench: 7.*} | |
- {php: 8.1, laravel: 10.*, testbench: 8.*} | |
- {php: 8.2, laravel: 10.*, testbench: 8.*} | |
- {php: 8.3, laravel: 10.*, testbench: 8.*} | |
- {php: 8.2, laravel: 11.*, testbench: 9.*} | |
- {php: 8.3, laravel: 11.*, testbench: 9.*} | |
- {php: 8.4, laravel: 11.*, testbench: 9.*} | |
name: PHP ${{ matrix.php-laravel-testbench.php }} - Laravel ${{ matrix.php-laravel-testbench.laravel }} - Testbench ${{ matrix.php-laravel-testbench.testbench }} - ${{ matrix.stability }} - ${{ matrix.os }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php-laravel-testbench.php }} | |
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo | |
coverage: none | |
- name: Setup problem matchers | |
run: | | |
echo "::add-matcher::${{ runner.tool_cache }}/php.json" | |
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" | |
- name: Install dependencies | |
run: | | |
if ($env:RUNNER_OS -eq 'Linux') { | |
composer require "laravel/framework:${{ matrix.php-laravel-testbench.laravel }}" --no-update || { echo 'Installing Laravel framework failed' ; exit 1; } | |
composer require "orchestra/testbench:${{ matrix.php-laravel-testbench.testbench }}" --dev --no-update || { echo 'Installing Orchestra Testbench failed' ; exit 1; } | |
composer update --${{ matrix.stability }} --prefer-dist --no-interaction || { echo 'Composer update failed' ; exit 1; } | |
} elseif ($env:RUNNER_OS -eq 'Windows') { | |
composer require "laravel/framework:${{ matrix.php-laravel-testbench.laravel }}" --no-update || exit 1 | |
composer require "orchestra/testbench:${{ matrix.php-laravel-testbench.testbench }}" --dev --no-update || exit 1 | |
composer update --${{ matrix.stability }} --prefer-dist --no-interaction || exit 1 | |
} | |
shell: pwsh | |
- name: Execute tests | |
run: vendor/bin/pest |