add phpstan level 5 baseline #418
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: Tests | |
on: | |
push: | |
pull_request: | |
schedule: | |
- cron: '0 0 * * MON' | |
jobs: | |
run: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
php: | |
- 8.0 | |
- 8.1 | |
- 8.2 | |
- 8.3 | |
- 8.4 | |
composer: | |
- v2 | |
name: Run Unit Tests on PHP ${{ matrix.php }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php }} | |
extensions: bcmath, bz2, gettext, mbstring, memcached, mcrypt, mysqli, opcache, pdo_mysql, zip, pdo, intl, json, pdo_pgsql, pgsql, session, simplexml, xml | |
tools: composer:v1, pecl | |
- name: Install vendors | |
run: composer install --prefer-source --no-interaction | |
- name: Run Atoum tests | |
run: php vendor/bin/atoum | |
static-code-analysis: | |
name: "Static Code Analysis" | |
runs-on: "ubuntu-latest" | |
strategy: | |
matrix: | |
php-version: | |
- "8.1" | |
dependencies: | |
- "locked" | |
steps: | |
- name: "Checkout" | |
uses: "actions/checkout@v3" | |
- name: "Install PHP with extensions" | |
uses: "shivammathur/[email protected]" | |
with: | |
coverage: "none" | |
php-version: "${{ matrix.php-version }}" | |
extensions: bcmath, bz2, gettext, mbstring, memcached, mcrypt, mysqli, opcache, pdo_mysql, zip, pdo, intl, json, pdo_pgsql, pgsql, session, simplexml, xml | |
tools: composer:v1, pecl | |
- name: "Set up problem matchers for PHP" | |
run: "echo \"::add-matcher::${{ runner.tool_cache }}/php.json\"" | |
- name: "Install ${{ matrix.dependencies }} dependencies with composer" | |
uses: "ramsey/[email protected]" | |
with: | |
dependency-versions: "${{ matrix.dependencies }}" | |
- name: "Create cache directory for phpstan/phpstan" | |
run: "mkdir -p .build/phpstan" | |
- name: "Cache cache directory for phpstan/phpstan" | |
uses: "actions/cache@v3" | |
with: | |
path: ".build/phpstan" | |
key: "php-${{ matrix.php-version }}-phpstan-${{ github.sha }}" | |
restore-keys: "php-${{ matrix.php-version }}-phpstan-" | |
- name: "Run phpstan/phpstan" | |
run: "vendor/bin/phpstan analyse --configuration=phpstan.neon.dist --memory-limit=-1" |