Add support for Carbon^3 #310
Workflow file for this run
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 / PHPUnit | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
- develop | |
- release/** | |
jobs: | |
php-tests: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
php: [7.4, 8.0, 8.1, 8.2, 8.3] | |
laravel: [6.*, 7.*, 8.*, 9.*, 10.*, 11.*] | |
stability: [prefer-lowest, prefer-stable] | |
os: [ubuntu-latest] | |
coverage: [none] | |
exclude: | |
- laravel: 6.* | |
php: 8.1 | |
- laravel: 6.* | |
php: 8.2 | |
- laravel: 6.* | |
php: 8.3 | |
- laravel: 7.* | |
php: 8.1 | |
- laravel: 7.* | |
php: 8.2 | |
- laravel: 7.* | |
php: 8.3 | |
- laravel: 8.* | |
php: 8.2 | |
stability: prefer-lowest | |
- laravel: 8.* | |
php: 8.3 | |
- laravel: 9.* | |
php: 7.4 | |
- laravel: 9.* | |
php: 8.2 | |
stability: prefer-lowest | |
- laravel: 9.* | |
php: 8.3 | |
- laravel: 10.* | |
php: 7.4 | |
- laravel: 10.* | |
php: 8.0 | |
- laravel: 11.* | |
php: 7.4 | |
- laravel: 11.* | |
php: 8.0 | |
- laravel: 11.* | |
php: 8.1 | |
include: | |
- laravel: 6.* | |
dotenv: ^3.3 | |
- laravel: 7.* | |
dotenv: ^4.0 | |
- laravel: 8.* | |
dotenv: ^5.2 | |
- laravel: 9.* | |
dotenv: ^5.2 | |
- laravel: 10.* | |
dotenv: ^5.4.1 | |
- laravel: 11.* | |
dotenv: ^5.4.1 | |
- php: 8.0 | |
laravel: 9.* | |
stability: prefer-stable | |
os: ubuntu-latest | |
coverage: xdebug | |
dotenv: ^5.2 | |
- php: 8.1 | |
laravel: 10.* | |
stability: prefer-stable | |
os: ubuntu-latest | |
coverage: xdebug | |
dotenv: ^5.4.1 | |
name: '[PHP ${{ matrix.php }}] [Laravel ${{ matrix.laravel }} - ${{ matrix.stability }}] [${{ matrix.coverage }} coverage]' | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php }} | |
extensions: mbstring json openssl | |
coverage: xdebug | |
ini-values: memory_limit=-1 | |
- name: Setup Problem Matchers | |
run: | | |
echo "::add-matcher::${{ runner.tool_cache }}/php.json" | |
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" | |
- name: Get composer cache directory | |
id: composer-cache | |
run: echo "dir=$(composer config cache-dir)" >> $GITHUB_OUTPUT | |
- name: Set phpunit for PHP >= 8 but Laravel < 11 | |
run: composer require phpunit/phpunit:^9.4 --no-interaction --no-progress --no-update | |
if: matrix.php >= 8 || matrix.laravel != '11.*' | |
- name: Set phpunit for Laravel >= 11 | |
run: composer require phpunit/phpunit:^10 --no-interaction --no-progress --no-update | |
if: matrix.laravel == '11.*' | |
# Packages which are not striclty required for testing but could cause | |
# conflicts with other packages | |
- name: Remove packages not necessary | |
run: composer remove --dev rector/rector --no-interaction --no-progress --no-update | |
- name: Set Minimum Laravel ${{ matrix.laravel }} Versions | |
run: | | |
composer require "illuminate/contracts:${{ matrix.laravel }}" --no-interaction --no-progress --no-update | |
composer require "vlucas/phpdotenv:${{ matrix.dotenv }}" --no-interaction --no-progress --no-update --dev | |
- name: Cache dependencies | |
uses: actions/cache@v4 | |
with: | |
path: ${{ steps.composer-cache.outputs.dir }} | |
key: composer-${{ runner.os }}-${{ matrix.php }}-${{ matrix.laravel }}-${{ hashFiles('composer.json') }} | |
restore-keys: | | |
composer-${{ runner.os }}-${{ matrix.php }}-${{ matrix.laravel }} | |
composer-${{ runner.os }}-${{ matrix.php }}- | |
composer-${{ runner.os }}- | |
composer- | |
- name: Install dependencies | |
run: composer update --no-progress --${{ matrix.stability }} --prefer-dist --no-interaction --no-suggest | |
- name: Execute tests | |
run: composer test:ci | |
- name: Upload coverage | |
uses: codecov/codecov-action@v4 | |
if: matrix.coverage == 'xdebug' | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: ./coverage.xml | |
codecov_yml_path: ./codecov.yml |