-
Notifications
You must be signed in to change notification settings - Fork 8
74 lines (60 loc) · 1.98 KB
/
build.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: Build
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
run:
runs-on: 'ubuntu-22.04'
strategy:
matrix:
php-versions: [ '8.1', '8.2', '8.3' ]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Declare variables
id: vars
run: echo "composer_cache_dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
tools: cs2pr
- name: Lint PHP
run: find -L src -type f -name '*.php' -print0 | xargs -0 -n 1 -P $(nproc) php -l
- name: Cache composer
uses: actions/cache@v4
if: matrix.php-versions == 8.3
with:
path: ${{ steps.vars.outputs.composer_cache_dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Install dependencies
run: composer install --no-interaction
if: matrix.php-versions == 8.3
- name: Validate coding standards
run: php vendor/bin/php-cs-fixer fix -vvv --dry-run --using-cache=no --format=checkstyle | cs2pr
if: matrix.php-versions == 8.3
- name: Static Analysis
run: php vendor/bin/phpstan analyse --error-format=github
if: matrix.php-versions == 8.3
- name: Tests
run: php vendor/bin/phpunit --do-not-cache-result
if: matrix.php-versions == 8.3
- name: Setup Node
uses: actions/setup-node@v4
if: matrix.php-versions == 8.3
with:
node-version: '20.x'
cache: 'npm'
- name: Install npm dependencies
if: matrix.php-versions == 8.3
run: npm ci
- name: Prettier
if: matrix.php-versions == 8.3
run: npm run prettier:check
- name: Typescript
if: matrix.php-versions == 8.3
run: npm run type-check