-
Notifications
You must be signed in to change notification settings - Fork 3
77 lines (64 loc) · 2.37 KB
/
Copy pathcode-quality.yml
File metadata and controls
77 lines (64 loc) · 2.37 KB
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
75
76
77
name: Code Quality
on:
pull_request:
branches: [main, master, development]
concurrency:
group: quality-${{ github.head_ref || github.ref }}
cancel-in-progress: true
jobs:
php-checks:
name: ${{ matrix.check.name }}
runs-on: ubuntu-latest
# One job-level bound covers every matrix leg, so it must clear the
# SLOWEST leg. Lint/PHPCS/PHPMD/Psalm/PHPStan run ~4 min, but the PHPUnit
# leg has been observed at 18.9 min while SUCCEEDING — a 20 bound would
# leave ~6% headroom and turn a slow-but-healthy run into a red check.
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
check:
- { name: "PHP Lint", command: "composer lint" }
- { name: "PHPCS", command: "./vendor/bin/phpcs --standard=phpcs.xml" }
- { name: "PHPMD", command: "./vendor/bin/phpmd lib text phpmd.xml" }
- { name: "Psalm", command: "./vendor/bin/psalm --threads=1 --no-cache --output-format=github" }
- { name: "PHPStan", command: "./vendor/bin/phpstan analyse --memory-limit=1G" }
- { name: "PHPUnit", command: "./vendor/bin/phpunit --colors=always" }
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
extensions: mbstring, xml, ctype, iconv, intl, dom, filter, gd, json, posix, zip, soap
tools: composer:v2
- name: Cache Composer dependencies
uses: actions/cache@v4
with:
path: vendor
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install dependencies
run: composer install --no-progress --prefer-dist --optimize-autoloader
- name: ${{ matrix.check.name }}
run: ${{ matrix.check.command }}
frontend-quality:
name: Frontend Quality
runs-on: ubuntu-latest
# Observed max 5.3 min across 49 fleet runs; 20 leaves ample headroom.
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: ESLint
run: npm run lint
- name: Stylelint
run: npm run stylelint