-
Notifications
You must be signed in to change notification settings - Fork 112
52 lines (44 loc) · 1.21 KB
/
formatting.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
name: WP-Discourse Formatting
on:
pull_request:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
name: Formatting on PHP ${{ matrix.php }}
strategy:
matrix:
include:
- php: '5.6'
- php: '7.0'
- php: '7.4'
- php: '8.0'
sniff: true
jshint: true
steps:
- uses: actions/checkout@v3
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
- name: Syntax Check
run: |
find -L . -name '*.php' -not -path "./vendor/*" -not -path "./tests/*" -print0 | xargs -0 -n 1 -P 4 php -l
- name: Install Composer
if: 'matrix.sniff'
uses: ramsey/composer-install@v2
with:
dependency-versions: 'highest'
composer-options: '--ignore-platform-reqs'
- name: WordPress Coding Standards
if: 'matrix.sniff'
run: |
vendor/bin/phpcs -p -s -v -n . -d error_reporting=E_ALL^E_DEPRECATED
- name: JSHint
if: 'matrix.jshint'
run: |
sudo npm install -g jshint
wget https://develop.svn.wordpress.org/trunk/.jshintrc
jshint .