-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (37 loc) · 1.09 KB
/
phpcs.yml
File metadata and controls
45 lines (37 loc) · 1.09 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
# cspell:ignore shivammathur reqs
name: PHP Code Standards
on:
pull_request:
push:
branches:
- main
jobs:
phpcs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Configure PHP environment
uses: shivammathur/setup-php@v2
with:
php-version: "8.0"
extensions: mbstring, intl
coverage: none
- uses: ramsey/composer-install@v3
with:
composer-options: "--ignore-platform-reqs --optimize-autoloader"
dependency-versions: highest
- if: github.ref == 'refs/heads/main'
name: Run full phpcs check
run: composer phpcs
- if: github.ref != 'refs/heads/main'
name: Run partial phpcs check
run: |
# if the base branch is not set, we assume it's main
if [ -z "$GITHUB_BASE_REF" ]; then
GITHUB_BASE_REF="main"
fi
git remote set-branches origin "$GITHUB_BASE_REF"
git fetch origin --depth=1
composer phpcs:ci "origin/$GITHUB_BASE_REF"