-
Notifications
You must be signed in to change notification settings - Fork 24
50 lines (40 loc) · 1.49 KB
/
ci.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
name: CI
on: [ push, pull_request ]
jobs:
ci:
name: CI
runs-on: ubuntu-20.04
strategy:
matrix:
php-versions: [ '7.4', '8.0', '8.1', '8.2' ]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
- name: Lint PHP
run: find -L . -path ./vendor -prune -o -type f -name '*.php' -print0 | xargs -0 -n 1 -P $(nproc) php -l
- name: Declare variables
if: matrix.php-versions == 8.1
id: vars
run: |
echo "::set-output name=composer_cache_dir::$(composer config cache-files-dir)"
- name: Cache composer
if: matrix.php-versions == 8.1
uses: actions/cache@v3
with:
path: ${{ steps.vars.outputs.composer_cache_dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Install dependencies
if: matrix.php-versions == 8.1
run: composer install --no-interaction --no-ansi
- name: Validate coding standards
if: matrix.php-versions == 8.1
run: php vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.php --verbose --diff --dry-run --stop-on-violation --using-cache=no
- name: Static analysis
if: matrix.php-versions == 8.1
run: php vendor/bin/phpstan analyse --configuration=phpstan.neon --verbose