Skip to content

Merge pull request #14 from ray-di/license/copyright-to-2024 #34

Merge pull request #14 from ray-di/license/copyright-to-2024

Merge pull request #14 from ray-di/license/copyright-to-2024 #34

name: Continuous Integration
on:
push:
paths-ignore:
- '**.md'
pull_request:
workflow_dispatch:
env:
COMPOSER_FLAGS: "--ansi --no-interaction --no-progress --prefer-dist"
COMPOSER_UPDATE_FLAGS: ""
jobs:
phpunit:
name: PHPUnit
runs-on: ubuntu-latest
strategy:
matrix:
php: [8.0, 8.1, 8.2, 8.3]
laravel: [8, 9, 10, 11]
dependency: [lowest, highest]
os: [ubuntu-latest]
exclude:
- php: 8.0
laravel: 10
- php: 8.0
laravel: 11
- php: 8.1
laravel: 11
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup PHP ${{ matrix.php }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: pcov
ini-values: zend.assertions=1
- name: Get composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache dependencies
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Handle lowest dependencies update
if: contains(matrix.dependency, 'lowest')
run: echo COMPOSER_UPDATE_FLAGS=$COMPOSER_UPDATE_FLAGS --prefer-lowest >> $GITHUB_ENV
- name: Update dependencies
run: composer update ${{ env.COMPOSER_UPDATE_FLAGS }} ${{ env.COMPOSER_FLAGS }}
- name: Update laravel
run: composer update ${{ env.COMPOSER_UPDATE_FLAGS }} ${{ env.COMPOSER_FLAGS }} -W laravel/framework:^${{ matrix.laravel }}
- name: Run test suite
run: ./vendor/bin/phpunit --coverage-clover=coverage.xml
- name: Upload coverage report
uses: codecov/codecov-action@v3
with:
file: ./coverage.xml