-
Notifications
You must be signed in to change notification settings - Fork 112
54 lines (46 loc) · 1.2 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
53
54
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'
sniff: true
- php: '7.0'
sniff: true
- php: '7.4'
sniff: true
jshint: true
- php: '8.0'
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/*" -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 .
- name: JSHint
if: 'matrix.jshint'
run: |
sudo npm install -g jshint
wget https://develop.svn.wordpress.org/trunk/.jshintrc
jshint .