-
Notifications
You must be signed in to change notification settings - Fork 0
80 lines (68 loc) · 2.61 KB
/
code-analysis.yml
File metadata and controls
80 lines (68 loc) · 2.61 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: PHP Code Analysis
on:
pull_request:
branches: [ main ]
push:
branches: [ main ]
jobs:
php-stan:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: ['7.4']
steps:
- name: Install PHP 7.4
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: intl #optional
ini-values: "post_max_size=256M" #optional
- name: Install wordpress
run: |
curl -O https://wordpress.org/latest.tar.gz
tar xzvf latest.tar.gz
rm latest.tar.gz
- name: Install woocommerce plugin
run: |
wget https://downloads.wordpress.org/plugin/woocommerce.latest-stable.zip
unzip woocommerce.latest-stable.zip
rm woocommerce.latest-stable.zip
working-directory: wordpress/wp-content/plugins
- name: Install woocommerce-subscriptions plugin
run: |
git clone https://github.com/wp-premium/woocommerce-subscriptions.git
working-directory: wordpress/wp-content/plugins
- name: Install wordpress-develop-tests plugin
run: |
git clone https://github.com/bobbingwide/wordpress-develop-tests.git
working-directory: wordpress/wp-content/plugins
- run: mkdir wordpress/wp-content/plugins/plugin-wordpress
- uses: actions/checkout@v2
with:
path: wordpress/wp-content/plugins/plugin-wordpress
- name: Install and run PhpStan
run: |
composer install --no-interaction
composer prefix-dependencies
php ./vendor/bin/phpstan analyze
working-directory: wordpress/wp-content/plugins/plugin-wordpress
- name: Install PHP 7.4
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
extensions: intl #optional
ini-values: "post_max_size=256M" #optional
- name: Run php7.4 linter
run: |
find . -path ./vendor -prune -false -o -type f -name '*.php' -print0 | xargs -0 -n1 -P$(nproc) php7.4 -l -n | (! grep -v "No syntax errors detected" )
working-directory: wordpress/wp-content/plugins/plugin-wordpress
- name: Install PHP 8.2
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
extensions: intl #optional
ini-values: "post_max_size=256M" #optional
- name: Run php8.2 linter
run: |
find . -path ./vendor -prune -false -o -type f -name '*.php' -print0 | xargs -0 -n1 -P$(nproc) php8.2 -l -n | (! grep -v "No syntax errors detected" )
working-directory: wordpress/wp-content/plugins/plugin-wordpress