php: phpstan run after phpunit #131
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: build | |
on: | |
push: | |
branches: [ master, '*.*' ] | |
pull_request: | |
branches: [ master ] | |
permissions: | |
contents: read | |
jobs: | |
unit: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
php_version: ['8.1', '8.2', '8.3', '8.4'] | |
laravel_version: ['^9.0', '^10.0', '^11.0'] | |
exclude: | |
- php_version: '8.1' | |
laravel_version: '^11.0' | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup PHP with PECL extension | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php_version }} | |
- name: Cache Composer packages | |
id: composer-cache | |
uses: actions/cache@v3 | |
with: | |
path: vendor | |
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} | |
restore-keys: | | |
${{ runner.os }}-php-${{ matrix.php_version }}-laravel-${{ matrix.laravel_version }} | |
- name: Install dependencies | |
run: composer require laravel/framework ${{ matrix.laravel_version }} --prefer-dist --no-progress | |
- name: PHPUnit | |
run: vendor/bin/phpunit --coverage-clover coverage.xml --configuration phpunit.php${{ matrix.php_version }}.xml.dist | |
- name: PHPStan | |
run: vendor/bin/phpstan analyze | |
- name: Coverage | |
run: bash <(curl -s https://codecov.io/bash) |