-
-
Notifications
You must be signed in to change notification settings - Fork 103
62 lines (56 loc) · 2 KB
/
lint-and-analyse-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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: Lint and analyse php files
on:
push:
pull_request:
types: [opened, synchronize, reopened]
jobs:
lint-php:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use PHP 8.2
uses: shivammathur/setup-php@v2
with:
php-version: 8.2
- name: Validate composer.json and composer.lock
run: composer validate
- name: Cache module
uses: actions/cache@v3
with:
path: ~/.composer/cache/
key: composer-cache
- name: Install dependencies
run: composer install
- name: Lint files
run: composer run phpcs
analyse-php:
runs-on: ubuntu-latest
strategy:
matrix:
php-version: ["8.2"]
steps:
- uses: actions/checkout@v3
- name: Use PHP ${{ matrix.php-version }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
tools: composer:v2
- name: Get Composer cache directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache dependencies
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: composer-${{ runner.os }}-${{ matrix.php-version }}-${{ hashFiles('**/composer.*') }}
restore-keys: |
composer-${{ runner.os }}-${{ matrix.php-version }}-
- name: Install dependencies
run: composer install
- name: Analyse files with PHPStan
run: composer run phpstan
- name: Analyse files with Psalm
# Allow the previous check to fail but not abort
if: always()
run: composer run psalm -- --shepherd