@@ -3,7 +3,7 @@ name: PHP Tests
3
3
on :
4
4
push :
5
5
branches-ignore :
6
- - ' master'
6
+ - " master"
7
7
env :
8
8
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD : true
9
9
CYPRESS_INSTALL_BINARY : 0
@@ -18,80 +18,49 @@ jobs:
18
18
- name : Setup PHP version
19
19
uses : shivammathur/setup-php@v2
20
20
with :
21
- php-version : ' 7.4'
21
+ php-version : " 7.4"
22
22
extensions : simplexml
23
23
tools : composer:v2.1
24
24
- name : Checkout source code
25
- uses : actions/checkout@v2
26
- - name : Get Composer Cache Directory
27
- id : composer-cache
28
- run : |
29
- echo "::set-output name=dir::$(composer config cache-files-dir)"
30
- - name : Setup Composer cache
31
- uses : actions/cache@v1
32
- with :
33
- path : ${{ steps.composer-cache.outputs.dir }}
34
- key : ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
35
- restore-keys : |
36
- ${{ runner.os }}-composer-
25
+ uses : actions/checkout@v4
37
26
- name : Install composer
38
27
run : COMPOSER=composer-dev.json composer install --prefer-dist --no-progress --no-suggest
39
28
- name : Run PHPCS
40
29
run : composer run lint
41
30
42
31
phpunit :
43
- name : PHPUnit
44
- runs-on : ubuntu-22.04
45
- services :
46
- mysql :
47
- image : mysql:5.7
48
- env :
49
- MYSQL_ROOT_PASSWORD : root
50
- ports :
51
- - 3306/tcp
52
- options : --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
53
- steps :
54
- - name : Setup PHP version
55
- uses : shivammathur/setup-php@v2
56
- with :
57
- php-version : ' 7.4'
58
- extensions : simplexml, mysql
59
- tools : phpunit-polyfills
60
- - name : Checkout source code
61
- uses : actions/checkout@v2
62
- - name : Install WordPress Test Suite
63
- run : |
64
- bash bin/install-wp-tests.sh wordpress_test root root 127.0.0.1:${{ job.services.mysql.ports['3306'] }}
65
- - name : Get Composer Cache Directory
66
- id : composer-cache
67
- run : |
68
- echo "::set-output name=dir::$(composer config cache-files-dir)"
69
- - name : Setup Composer cache
70
- uses : actions/cache@v1
71
- with :
72
- path : ${{ steps.composer-cache.outputs.dir }}
73
- key : ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
74
- restore-keys : |
75
- ${{ runner.os }}-composer-
76
- - name : Install composer
77
- run : COMPOSER=composer-dev.json composer install --prefer-dist --no-progress --no-suggest --no-dev
78
- - name : Run phpunit
79
- run : phpunit
80
-
32
+ name : PHPUnit
33
+ runs-on : ubuntu-22.04
34
+ services :
35
+ mysql :
36
+ image : mysql:5.7
37
+ env :
38
+ MYSQL_ROOT_PASSWORD : root
39
+ ports :
40
+ - 3306/tcp
41
+ options : --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
42
+ steps :
43
+ - name : Setup PHP version
44
+ uses : shivammathur/setup-php@v2
45
+ with :
46
+ php-version : " 7.4"
47
+ extensions : simplexml, mysql
48
+ tools : phpunit-polyfills
49
+ - name : Checkout source code
50
+ uses : actions/checkout@v4
51
+ - name : Install WordPress Test Suite
52
+ run : |
53
+ bash bin/install-wp-tests.sh wordpress_test root root 127.0.0.1:${{ job.services.mysql.ports['3306'] }}
54
+ - name : Install composer
55
+ run : COMPOSER=composer-dev.json composer install --prefer-dist --no-progress --no-suggest --no-dev
56
+ - name : Run phpunit
57
+ run : phpunit
81
58
82
59
themecheck :
83
60
name : Theme Check
84
61
runs-on : ubuntu-latest
85
62
steps :
86
- - uses : actions/checkout@v2
87
- - name : Get Composer Cache Directory
88
- id : composer-cache
89
- run : |
90
- echo "::set-output name=dir::$(composer config cache-files-dir)"
91
- - uses : actions/cache@v1
92
- with :
93
- path : ${{ steps.composer-cache.outputs.dir }}
94
- key : ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
63
+ - uses : actions/checkout@v4
95
64
- run : ./bin/envs/init.sh theme-check latest yes
96
65
phpstan :
97
66
name : PHPStan
@@ -100,21 +69,10 @@ jobs:
100
69
- name : Setup PHP version
101
70
uses : shivammathur/setup-php@v2
102
71
with :
103
- php-version : ' 7.4'
72
+ php-version : " 7.4"
104
73
extensions : simplexml, mysql
105
74
- name : Checkout source code
106
- uses : actions/checkout@v2
107
- - name : Get Composer Cache Directory
108
- id : composer-cache
109
- run : |
110
- echo "::set-output name=dir::$(composer config cache-files-dir)"
111
- - name : Setup Composer cache
112
- uses : actions/cache@v1
113
- with :
114
- path : ${{ steps.composer-cache.outputs.dir }}
115
- key : ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
116
- restore-keys : |
117
- ${{ runner.os }}-composer-
75
+ uses : actions/checkout@v4
118
76
- name : Install composer
119
77
run : COMPOSER=composer-dev.json composer install
120
78
- name : PHPStan Static Analysis
0 commit comments