Update composer.json #44
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, pull_request] | |
jobs: | |
tests: | |
runs-on: ubuntu-22.04 | |
strategy: | |
fail-fast: true | |
matrix: | |
php: [8.3, 8.2] | |
laravel: [11.0, 10.2] | |
name: Unit/Feature Tests - P${{ matrix.php }} - L${{ matrix.laravel }} | |
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 | |
ini-values: error_reporting=E_ALL | |
tools: composer:v2 | |
coverage: none | |
- name: Install dependencies | |
run: | | |
composer require "illuminate/contracts=^${{ matrix.laravel }}" --dev --no-update | |
composer update --prefer-dist --no-interaction --no-progress | |
- name: Execute tests | |
run: vendor/bin/phpunit | |
stub-tests: | |
runs-on: ubuntu-22.04 | |
strategy: | |
fail-fast: false | |
matrix: | |
php: [8.3, 8.2] | |
laravel: [11.0, 10.2] | |
name: Dusk Tests - P${{ matrix.php }} - L${{ matrix.laravel }} | |
steps: | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php }} | |
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, mysql, mysqli, pdo_mysql, fileinfo | |
coverage: none | |
- name: Setup Laravel | |
run: | | |
composer create-project laravel/laravel:^${{ matrix.laravel }} . | |
composer require protonemedia/laravel-splade | |
composer require laravel/jetstream | |
- name: Remove installed Jetstream | |
run: rm -rf vendor/laravel/jetstream | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
with: | |
path: "vendor/laravel/jetstream" | |
- name: Install Jetstream and Setup Dusk environment | |
run: | | |
composer dump | |
php artisan jetstream:install --teams --api --verification | |
sed -i -e 's/waitSeconds = 5/waitSeconds = 10/g' vendor/laravel/dusk/src/Browser.php | |
php artisan dusk:chrome-driver `/opt/google/chrome/chrome --version | cut -d " " -f3 | cut -d "." -f1` | |
- name: Start Chrome Driver | |
run: ./vendor/laravel/dusk/bin/chromedriver-linux & | |
- name: Run Laravel Server | |
run: php artisan serve & | |
- name: Run Dusk Tests | |
uses: nick-invision/retry@v2 | |
with: | |
timeout_minutes: 10 | |
max_attempts: 3 | |
command: php artisan dusk --env=dusk | |
- name: Upload Dusk Screenshots | |
if: failure() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: screenshots | |
path: tests/Browser/screenshots | |
- name: Upload Console Logs | |
if: failure() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: console | |
path: tests/Browser/console | |
- name: Upload Laravel Logs | |
if: failure() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: logs | |
path: storage/logs |