Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

CI

CI #255

Workflow file for this run

name: CI
on:
push:
pull_request:
schedule:
- cron: '0 0 * * *'
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
php: ['8.1', '8.2']
laravel: ['9.*', '10.*']
include:
- laravel: '9.*'
testbench: '7.*'
- laravel: '10.*'
testbench: '8.*'
name: P${{ matrix.php }} - L${{ matrix.laravel }}
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Cache dependencies
uses: actions/cache@v3
with:
path: ~/.composer/cache/files
key: dependencies-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: curl, json, mbstring, zip, sqlite, pdo_sqlite
coverage: pcov
- name: Install dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
composer update --prefer-dist --no-interaction
# Lower PHP and laravel versions.
- name: PHPUnit without code coverage
if: matrix.php != '8.2' || matrix.laravel != '10.*'
run: vendor/bin/testbench package:test --parallel --no-coverage
# Last PHP and laravel versions.
- name: Code analysis
if: matrix.php == '8.2' && matrix.laravel == '10.*'
run: |
# Remove this line once Larastan and Livewire are working well together
sed -i -e 's#.*protected \$enablesPackageDiscoveries.*#&\nprotected function overrideApplicationBindings($app){return["brickables"=>"Okipa\\\\LaravelBrickables\\\\Brickables"];}#' vendor/nunomaduro/larastan/src/ApplicationResolver.php
vendor/bin/pint --test -vvv
vendor/bin/phpmd config,src,tests text phpmd.xml
vendor/bin/phpstan analyse
- name: PHPUnit with code coverage
if: matrix.php == '8.2' && matrix.laravel == '10.*'
run: |
mkdir -p build/logs
vendor/bin/testbench package:test --parallel --coverage-text --coverage-clover build/logs/clover.xml
- name: Code coverage upload to Coveralls
if: env.COVERALLS_REPO_TOKEN && matrix.php == '8.2' && matrix.laravel == '10.*'
env:
COVERALLS_RUN_LOCALLY: 1
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
run: |
composer require php-coveralls/php-coveralls --with-all-dependencies
vendor/bin/php-coveralls -v --coverage_clover=build/logs/clover.xml