Skip to content

Add PHP 8.5 to cross-platform tests #2

Add PHP 8.5 to cross-platform tests

Add PHP 8.5 to cross-platform tests #2

Workflow file for this run

name: PHPUnit
on:
push:
branches: [ main, master, develop ]
pull_request:
branches: [ main, master, develop ]
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: ['8.1', '8.2', '8.3', '8.4', '8.5']
laravel: ['10.*', '11.*', '12.*']
dependency-version: [prefer-lowest, prefer-stable]
include:
- laravel: 10.*
testbench: 8.*
- laravel: 11.*
testbench: 9.*
- laravel: 12.*
testbench: 10.*
exclude:
- laravel: 11.*
php: '8.1'
- laravel: 12.*
php: '8.1'
name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }}
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, 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: Cache Composer packages
id: composer-cache
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-php-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-${{ matrix.php }}-
- name: Install dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" --no-interaction --no-update
if [ "${{ matrix.php }}" = "8.5" ]; then
composer config platform.php 8.4.0
fi
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction
- name: List Installed Dependencies
run: composer show -D
- name: Execute tests
run: vendor/bin/phpunit
code-style:
runs-on: ubuntu-latest
name: Code Style
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'npm'
- name: Install Node.js dependencies
run: npm install
- name: Check code style with Prettier
run: npm run format:check
coverage:
runs-on: ubuntu-latest
name: Coverage
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.3
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo
coverage: xdebug
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-php-8.3-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-8.3-
- name: Install dependencies
run: composer install --prefer-dist --no-interaction
- name: Execute tests with coverage
run: vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
file: ./coverage.clover
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}