Skip to content

[V2]

[V2] #17

Workflow file for this run

name: laravel
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
test:
runs-on: ${{ matrix.operating-system }}
strategy:
fail-fast: false
matrix:
operating-system: [ ubuntu-latest ]
php: [ '8.1', '8.2', '8.3', '8.4' ]
laravel: [ '10.0', '11.0' ]
dependencies: [ 'lowest', 'highest' ]
name: PHP ${{ matrix.php }} / Laravel ${{ matrix.laravel }} on ${{ matrix.operating-system }} with ${{ matrix.dependencies }} dependencies
steps:
- uses: actions/checkout@v2
name: Checkout repository
- name: Cache dependencies
uses: actions/cache@v4
with:
path: ~/.composer/cache/files
key: dependencies-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: pcov
- name: Install framework deps
run: |
composer require --dev laravel/laravel "^${{ matrix.laravel }}"
- name: Composer install
uses: ramsey/composer-install@v3
with:
dependency-versions: ${{ matrix.dependencies }}
composer-options: ${{ matrix.composer-options }}
- name: PHPUnit + Code coverage
run: |
mkdir -p build/logs
vendor/bin/phpunit --coverage-text --coverage-clover build/logs/clover.xml
- name: Code coverage upload to Coveralls
if: matrix.php == '8.0' && matrix.dependencies == 'highest' && matrix.laravel == '8.0'
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
composer require php-coveralls/php-coveralls -W
vendor/bin/php-coveralls -v --coverage_clover=build/logs/clover.xml