php-framework/.github/workflows/tests.yml

51 lines
1.2 KiB
YAML

name: Tests
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
tests:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
php: [8.2, 8.3, 8.4]
laravel: [11.*, 12.*]
exclude:
- php: 8.2
laravel: 12.*
name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip
coverage: xdebug
- name: Install dependencies
env:
LARAVEL_VERSION: ${{ matrix.laravel }}
run: |
composer require "laravel/framework:${LARAVEL_VERSION}" --no-interaction --no-update
composer update --prefer-dist --no-interaction --no-progress
- name: Execute tests with coverage
run: vendor/bin/phpunit --coverage-clover=coverage.xml
- name: Upload coverage to Codecov
if: matrix.php == '8.3' && matrix.laravel == '11.*'
uses: codecov/codecov-action@v3
with:
files: ./coverage.xml
fail_ci_if_error: false
verbose: true