Skip to content

Run Tests

Run Tests #1122

Workflow file for this run

name: Run Tests
on:
push:
branches:
- '*.x'
pull_request:
schedule:
- cron: '0 0 * * *'
jobs:
phpunit:
name: PHP ${{ matrix.php-version }} - Laravel ${{ matrix.laravel-version }}
runs-on: ubuntu-latest
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
php-version: ['8.1', '8.2', '8.3', '8.4']
laravel-version: [^10.0, ^11.0]
exclude:
- php-version: '8.1'
laravel-version: ^11.0
- php-version: '8.4'
laravel-version: ^10.0
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
- name: Cache dependencies
uses: actions/cache@v4
with:
path: ~/.composer/cache/files
key: php-${{ matrix.php-version }}-composer-${{ hashFiles('composer.json') }}
- name: Validate Composer files
run: composer validate
- name: Update composer.json
run: composer require laravel/framework:${{ matrix.laravel-version }} --no-update --dev
- name: Install dependencies
run: composer update --prefer-stable --prefer-dist --no-interaction --no-progress
- name: Check for style violations
run: PHP_CS_FIXER_IGNORE_ENV=1 vendor/bin/php-cs-fixer fix --dry-run --diff
- name: Clone the laravel skeleton
run: git clone https://github.com/laravel/laravel.git --single-branch --depth 1
- name: Run test suite
run: vendor/bin/phpunit