-
Notifications
You must be signed in to change notification settings - Fork 2
44 lines (36 loc) · 1.15 KB
/
lint-php.yml
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
name: PHP Lint
on:
pull_request:
branches: [ "main" ]
types: [opened, synchronize, reopened, ready_for_review]
paths:
- '**.php'
- 'composer.json'
- 'composer.lock'
- 'phpunit.xml'
jobs:
lint-php:
name: Lint PHP
timeout-minutes: 10
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Validate composer.json and composer.lock
run: composer validate
- name: Cache dependencies
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-composer-dependencies-${{ hashFiles('composer.lock') }}
restore-keys: ${{ runner.os }}-composer-dependencies
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.2
extensions: ctype, curl, dom, fileinfo, filter, hash, mbstring, openssl, pcre, pdo, session, tokenizer, xml
coverage: none
- name: Install Composer dependencies
run: composer install --prefer-dist --no-interaction --no-suggest
- name: Run PHP linter
run: ./vendor/bin/pint --test