mirror of
https://github.com/danog/Valinor.git
synced 2025-01-05 20:28:33 +01:00
9e66b951b7
This also uses `ramsey/composer-install@v2` to cache dependencies, instead of having to set up the automation on our own with `actions/cache` (messy).
58 lines
1.5 KiB
YAML
58 lines
1.5 KiB
YAML
name: Coding Standards & Static Analysis
|
|
on: [push, pull_request]
|
|
jobs:
|
|
qa:
|
|
name: Quality Assurance
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
php-version: '8.1'
|
|
php-extensions: xdebug, yaml
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Setup cache environment
|
|
id: extcache
|
|
uses: shivammathur/cache-extensions@v1
|
|
with:
|
|
php-version: ${{ matrix.php }}
|
|
extensions: ${{ env.php-extensions }}
|
|
key: qa-php-extensions-${{ runner.os }}-${{ env.php-version }}
|
|
|
|
- name: Cache PHP extensions
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: ${{ steps.extcache.outputs.dir }}
|
|
key: ${{ steps.extcache.outputs.key }}
|
|
restore-keys: ${{ steps.extcache.outputs.key }}
|
|
|
|
- name: Setup PHP
|
|
uses: shivammathur/setup-php@v2
|
|
with:
|
|
php-version: ${{ env.php-version }}
|
|
extensions: ${{ env.php-extensions }}
|
|
ini-values: zend.assertions=1
|
|
|
|
- name: Cache PHPStan results
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: var/cache/phpstan
|
|
key: phpstan
|
|
|
|
- name: Checking Composer
|
|
run: composer validate
|
|
|
|
- name: Creating var directory
|
|
run: mkdir -p var/cache
|
|
|
|
- uses: "ramsey/composer-install@v2"
|
|
|
|
- name: Running PHP Coding Standards Fixer
|
|
run: php vendor/bin/php-cs-fixer fix --dry-run
|
|
|
|
- name: Running PHPStan
|
|
run: php vendor/bin/phpstan
|
|
|
|
- name: Running Psalm
|
|
run: php vendor/bin/psalm
|