-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (43 loc) · 1.68 KB
/
code-quality-php.yml
File metadata and controls
53 lines (43 loc) · 1.68 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
name: Code Quality PHP
on:
push:
pull_request:
# Allow manually triggering the workflow.
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
code-quality:
name: Run Code Quality Checks
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
matrix:
php: [ "8.2", "8.3", "8.4" ]
fail-fast: false
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
# Do not store git credentials in .git -> could be leaked/exposed by infected/malicious action.
persist-credentials: false
- name: Setup PHP and tools
uses: shivammathur/setup-php@7c071dfe9dc99bdf297fa79cb49ea005b9fcadbc # v2.37.1
with:
php-version: ${{ matrix.php }}
tools: composer:v2, cs2pr, phpcs
- name: Validate composer.json
run: composer validate --strict
- name: Install Composer dependencies
uses: ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda # v4.0.0
with:
composer-options: "--prefer-dist --no-progress"
- name: Run PHP syntax linting
run: composer run-script lint
- name: Run PHP CodeSniffer
run: |
vendor/bin/phpcs -- --standard=phpcs.xml --report-checkstyle=./phpcs-report.xml
cs2pr ./phpcs-report.xml