@@ -3,41 +3,50 @@ name: Coding Standards and Tests
3
3
on : [ push ]
4
4
5
5
env :
6
- WP_TESTS_DIR : /github/ home/wp-tests/wordpress-tests-lib
7
- WP_CORE_DIR : /github/ home/wp-tests/wordpress
6
+ WP_TESTS_DIR : /home/runner /wp-tests/wordpress-tests-lib
7
+ WP_CORE_DIR : /home/runner /wp-tests/wordpress
8
8
9
9
jobs :
10
10
11
11
test :
12
12
runs-on : ubuntu-latest
13
13
strategy :
14
14
matrix :
15
- php-version : [ 5.6, 7.3, 7.4 ]
15
+ php-version : [ ' 5.6', ' 7.3', ' 7.4' ]
16
16
wordpress-version : [ latest ]
17
- container :
18
- image : junaidbhura/wp-tests:php-${{ matrix.php-version }}
19
17
services :
20
18
mysql :
21
19
image : mysql:5.7.27
22
20
env :
23
21
MYSQL_ROOT_PASSWORD : root
22
+ MYSQL_DATABASE : wordpress_test
23
+ ports :
24
+ - 3306:3306
25
+ options : --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=5s --health-retries=3
24
26
25
27
steps :
28
+ - name : Set up PHP
29
+ uses : shivammathur/setup-php@v2
30
+ with :
31
+ php-version : ${{ matrix.php-version }}
32
+ coverage : none
33
+ tools : composer, cs2pr
34
+
26
35
- name : Checkout repository
27
- uses : actions/checkout@v1
36
+ uses : actions/checkout@v2
28
37
29
38
- name : Composer cache
30
39
id : composer-cache
31
- uses : actions/cache@v1
40
+ uses : actions/cache@v2
32
41
with :
33
- path : /github/ home/.composer/vendor
34
- key : composer-${{ hashFiles( '.github/workflows/main.yml' ) }}-${{ matrix.php-version }}
42
+ path : /home/runner /.composer/vendor
43
+ key : composer-${{ hashFiles( '.github/workflows/main.yml' ) }}
35
44
36
45
- name : WordPress test suite cache
37
46
id : wp-test-suite
38
- uses : actions/cache@v1
47
+ uses : actions/cache@v2
39
48
with :
40
- path : /github/ home/wp-tests
49
+ path : /home/runner /wp-tests
41
50
key : wp-tests-${{ hashFiles( '.github/workflows/main.yml' ) }}-${{ matrix.wordpress-version }}
42
51
43
52
- name : Install Composer dependencies
@@ -47,17 +56,11 @@ jobs:
47
56
composer global require wp-coding-standards/wpcs
48
57
$HOME/.composer/vendor/bin/phpcs --config-set installed_paths $HOME/.composer/vendor/wp-coding-standards/wpcs
49
58
50
- - name : Wait for MySQL
51
- run : |
52
- while ! mysqladmin ping -h mysql -u root -p${MYSQL_ROOT_PASSWORD}; do
53
- sleep 1
54
- done
55
-
56
59
- name : Install WordPress test suite
57
- run : bash bin/install-wp-tests.sh wordpress_test root root mysql ${{ matrix.wordpress-version }}
60
+ run : bash bin/install-wp-tests.sh wordpress_test root root 0.0.0.0 ${{ matrix.wordpress-version }} true
58
61
59
62
- name : Coding standards
60
63
run : $HOME/.composer/vendor/bin/phpcs phpcs.ruleset.xml
61
64
62
- - name : Unit tests
65
+ - name : Tests
63
66
run : $HOME/.composer/vendor/bin/phpunit
0 commit comments