-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwpcs.yml
46 lines (36 loc) · 1.3 KB
/
wpcs.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
name: Test WordPress Coding Standard
on:
push:
branches: [ master, develop ]
jobs:
test-wpcs:
runs-on: ubuntu-20.04
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Install Dependencies
run: |
# Switching PHP
sudo update-alternatives --set php /usr/bin/php7.4
php -v
# Installing PHP_CodeSniffers
wget https://github.com/squizlabs/PHP_CodeSniffer/releases/download/3.7.1/phpcs.phar
chmod +x phpcs.phar
sudo mv phpcs.phar /usr/local/bin/phpcs
# Installing WPCS
wget https://github.com/WordPress/WordPress-Coding-Standards/archive/master.zip
unzip master.zip
mv WordPress-Coding-Standards-master ~/wpcs
# Installing PHPCompatibility
composer require phpcompatibility/php-compatibility
mv vendor/phpcompatibility/php-compatibility ~/PHPCompatibility
# Setting up paths
phpcs --config-set installed_paths /home/$USER/wpcs,/home/$USER/PHPCompatibility
phpcs -i
- name: Configure Standards
run: |
rm -f phpcs.xml
wget -O phpcs.xml https://raw.githubusercontent.com/WPPOOL/wppool-coding-standard/main/phpcs.xml
- name: Run Tests
run: |
phpcs .