23
23
24
24
matrix :
25
25
os : [ ubuntu-20.04 ]
26
- php : [ '5.6', ' 7.0', '7.1', '7.2', '7.3', '7.4' ]
26
+ php : [ '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2 ' ]
27
27
wordpress : [ latest, nightly ]
28
28
multisite : [ 0 ]
29
29
61
61
- name : Install PHPUnit
62
62
run : |
63
63
# for PHP Compatibility - https://phpunit.de/supported-versions.html
64
- if [[ $PHP_VERSION == "7.0" ]] ; then
64
+ if [[ ${PHP_VERSION:0:1} == "8" ]] ; then
65
+ composer global require "phpunit/phpunit=8.*"
66
+ elif [[ $PHP_VERSION == "7.0" ]] ; then
65
67
composer global require "phpunit/phpunit=5.7.*|6.*"
66
68
# for WP_VERSION < 4.6 due to PHP Fatal error: Class 'PHPUnit_Framework_TestCase' not found
67
69
elif [[ ${PHP_VERSION:0:1} == "7" ]] && [[ "$WP_VERSION" < 4.6* ]] ; then
@@ -74,10 +76,78 @@ jobs:
74
76
fi
75
77
76
78
- name : Install PHPUnit Polyfills library
77
- run : composer global require "yoast/phpunit-polyfills=1.0.3 "
79
+ run : composer global require "yoast/phpunit-polyfills=1.1.0 "
78
80
79
81
- name : Install wp tests
80
82
run : bash bin/install-wp-tests.sh wordpress_test root root 0.0.0.0:3306 $WP_VERSION
81
83
82
84
- name : Run PHPUnit - WordPress ${{ matrix.wordpress }} * Multisite ${{ matrix.multisite }}
83
- run : phpunit
85
+ run : |
86
+ if [[ $PHP_VERSION == "5.6" ]] || [[ $PHP_VERSION == "7.0" ]] ; then
87
+ phpunit --configuration phpunit-legacy.xml
88
+ else
89
+ phpunit
90
+ fi
91
+
92
+ phpunit-legacy :
93
+ name : WordPress ${{ matrix.wordpress }} * PHP v${{ matrix.php }} * ${{ matrix.os }} * Multisite ${{ matrix.multisite }}
94
+ runs-on : ${{ matrix.os }}
95
+ timeout-minutes : 30
96
+
97
+ strategy :
98
+ fail-fast : false
99
+
100
+ matrix :
101
+ os : [ ubuntu-20.04 ]
102
+ # WordPress 6.3 or later requires at least 7.0.0
103
+ php : [ '5.6' ]
104
+ wordpress : [ '6.1', '6.2' ]
105
+ multisite : [ 0 ]
106
+
107
+ env :
108
+ PHP_VERSION : ${{ matrix.php }}
109
+ WP_VERSION : ${{ matrix.wordpress }}
110
+ WP_MULTISITE : ${{ matrix.multisite }}
111
+
112
+ services :
113
+ database :
114
+ image : mysql:5.7
115
+ ports :
116
+ - 3306:3306
117
+ env :
118
+ MYSQL_ROOT_PASSWORD : root
119
+
120
+ steps :
121
+ - uses : actions/checkout@v3
122
+
123
+ - name : Setup PHP v${{ matrix.php }}
124
+ uses : shivammathur/setup-php@v2
125
+ with :
126
+ php-version : ${{ matrix.php }}
127
+ extensions : mbstring, intl, php-mysql
128
+
129
+ - name : Install PHPUnit
130
+ run : |
131
+ # for PHP Compatibility - https://phpunit.de/supported-versions.html
132
+ if [[ ${PHP_VERSION:0:1} == "8" ]] ; then
133
+ composer global require "phpunit/phpunit=8.*"
134
+ elif [[ $PHP_VERSION == "7.0" ]] ; then
135
+ composer global require "phpunit/phpunit=5.7.*|6.*"
136
+ # for WP_VERSION < 4.6 due to PHP Fatal error: Class 'PHPUnit_Framework_TestCase' not found
137
+ elif [[ ${PHP_VERSION:0:1} == "7" ]] && [[ "$WP_VERSION" < 4.6* ]] ; then
138
+ composer global require "phpunit/phpunit=5.7.*"
139
+ # for WP_VERSION < 5.0 due to Fatal error: Class PHPUnit_Util_Test may not inherit from final class (PHPUnit\Util\Test)
140
+ elif [[ ${PHP_VERSION:0:1} == "7" ]] && [[ "$WP_VERSION" < 5.0* ]] ; then
141
+ composer global require "phpunit/phpunit=5.7.*|6.*"
142
+ else
143
+ composer global require "phpunit/phpunit=4.8.*|5.4.*|5.7.*|6.*|7.*"
144
+ fi
145
+
146
+ - name : Install PHPUnit Polyfills library
147
+ run : composer global require "yoast/phpunit-polyfills=1.1.0"
148
+
149
+ - name : Install wp tests
150
+ run : bash bin/install-wp-tests.sh wordpress_test root root 0.0.0.0:3306 $WP_VERSION
151
+
152
+ - name : Run PHPUnit - WordPress ${{ matrix.wordpress }} * Multisite ${{ matrix.multisite }}
153
+ run : phpunit --configuration phpunit-legacy.xml
0 commit comments