Skip to content

Changes

Changes #16

Workflow file for this run

name: run-tests
on:
push:
pull_request:
schedule:
- cron: '0 0 * * *'
jobs:
test:
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
php: [8.0, 8.1, 8.2, 8.3]
laravel: ['8.*', '9.*', '10.*', '11.*']
dependency-version: [prefer-stable]
os: [ubuntu-latest]
exclude:
- php: '8.0'
laravel: '10.*'
- php: '8.0'
laravel: '11.*'
- php: '8.1'
laravel: '11.*'
- php: '8.2'
laravel: '8.*'
- php: '8.3'
laravel: '8.*'
- php: '8.3'
laravel: '9.*'
steps:
- name: Checkout code
uses: actions/[email protected]
- name: Cache dependencies
uses: actions/cache@v4
with:
path: ~/.composer/cache/files
key: dependencies-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}
restore-keys: |
dependencies-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-
dependencies-laravel-${{ matrix.laravel }}-php-
dependencies-laravel-
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlit3, pdo_sqlite
coverage: xdebug
tools: composer:v2
- name: Select Laravel 8
uses: nick-invision/retry@v2
with:
timeout_minutes: 5
max_attempts: 5
command: composer require "laravel/framework:^8.83.27" "phpunit/phpunit:^9.6.15" --no-update --no-interaction
if: "matrix.laravel == '8.*'"
- name: Select Laravel 9
uses: nick-invision/retry@v2
with:
timeout_minutes: 5
max_attempts: 5
command: composer require "laravel/framework:^9.52.16" "phpunit/phpunit:^9.6.15" --no-update --no-interaction
if: "matrix.laravel == '9.*'"
- name: Select Laravel 10
uses: nick-invision/retry@v2
with:
timeout_minutes: 5
max_attempts: 5
command: composer require "laravel/framework:^10.34.2" "phpunit/phpunit:^10.4.2" --no-update --no-interaction
if: "matrix.laravel == '10.*'"
- name: Select Laravel 11
uses: nick-invision/retry@v2
with:
timeout_minutes: 5
max_attempts: 5
command: composer require "laravel/framework:^11.0" "phpunit/phpunit:^10.4.2" --no-update --no-interaction
if: "matrix.laravel == '11.*'"
- name: Install PHP Dependencies
uses: nick-invision/retry@v2
with:
timeout_minutes: 5
max_attempts: 5
command: composer update --no-interaction --no-progress
- name: Execute tests
run: vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover
- name: Upload Codecov coverage
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.clover
flags: unittests
name: P${{ matrix.php }}-L${{ matrix.laravel }}-${{ matrix.dependency-version }}-${{ matrix.os }}-${{ github.sha }}