Skip to content

Phpstan level 6

Phpstan level 6 #666

Workflow file for this run

name: CI
on:
push:
pull_request:
jobs:
tests:
name: Tests (PHPUnit with PHP ${{ matrix.php }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
operating-system: ["ubuntu-latest"]
php: ["7.4", "8.0", "8.1", "8.2", "8.3", "8.4"]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
with:
php-version: ${{ matrix.php }}
tools: phpunit
extensions: mbstring, xml, ctype, iconv, intl, pdo_sqlite
coverage: xdebug
# Install composer dependencies and handle caching in one go.
# @link https://github.com/marketplace/actions/install-composer-dependencies
- name: "Install Composer dependencies"
uses: "ramsey/composer-install@v2"
- name: Run tests
run: vendor/bin/phpunit --no-coverage
code-quality:
name: Check ${{ matrix.tool }} (PHP ${{ matrix.php }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
operating-system: ["ubuntu-latest"]
php: ["8.3"]
tool: ["phpstan", "code-coverage", "code-style"]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
with:
php-version: ${{ matrix.php }}
tools: phpunit
extensions: mbstring, xml, ctype, iconv, intl, pdo_sqlite
coverage: xdebug
# Install composer dependencies and handle caching in one go.
# @link https://github.com/marketplace/actions/install-composer-dependencies
- name: "Install Composer dependencies"
uses: "ramsey/composer-install@v2"
- name: Run static code analysis
if: ${{ matrix.tool == 'phpstan' }}
run: composer run phpstan -- --error-format=github
- name: Run tests with coverage-clover
if: ${{ matrix.tool == 'code-coverage' }}
run: composer run phpunit -- --coverage-clover .phpunit.cache/clover.xml
- name: Upload coverage reports to Codecov
if: ${{ matrix.tool == 'code-coverage' }}
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./.phpunit.cache/clover.xml
fail_ci_if_error: true
verbose: true
- name: Check code-style
if: ${{ matrix.tool == 'code-style' }}
run: composer run codestyle -- --dry-run --diff