@@ -101,6 +101,134 @@ jobs:
101
101
- name : Run PHPUnit tests
102
102
run : vendor/bin/phpunit --colors=always
103
103
104
+ phpunit-postgresql :
105
+ name : PHPUnit (PHP ${{ matrix.php }}) (PostgreSQL)
106
+ runs-on : ubuntu-latest
107
+ container :
108
+ image : php:${{ matrix.php }}-alpine
109
+ services :
110
+ postgres :
111
+ image : postgres:10-alpine
112
+ env :
113
+ POSTGRES_DB : api_platform_test
114
+ POSTGRES_PASSWORD : hk7dFAByeQVVxpLtmZ6GVUzP
115
+ POSTGRES_USER : api-platform
116
+ options : --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
117
+ strategy :
118
+ matrix :
119
+ php :
120
+ - ' 7.3'
121
+ fail-fast : false
122
+ env :
123
+ APP_ENV : postgres
124
+ DATABASE_URL : postgres://api-platform:hk7dFAByeQVVxpLtmZ6GVUzP@postgres/api_platform_test
125
+ steps :
126
+ - name : Checkout
127
+ uses : actions/checkout@v1
128
+ - name : Install system packages
129
+ run : |
130
+ apk add \
131
+ unzip \
132
+ - name : Install PHP extensions
133
+ run : |
134
+ apk add \
135
+ $PHPIZE_DEPS \
136
+ postgresql-dev \
137
+ ;
138
+ docker-php-ext-install -j$(nproc) \
139
+ pdo_pgsql \
140
+ ;
141
+ - name : Install mongodb PHP extension
142
+ if : matrix.php != '7.1'
143
+ run : |
144
+ apk add $PHPIZE_DEPS
145
+ pecl install mongodb-1.5.5
146
+ docker-php-ext-enable mongodb
147
+ - name : Disable PHP memory limit
148
+ run : echo 'memory_limit=-1' >> /usr/local/etc/php/php.ini
149
+ - name : Install Composer
150
+ run : wget -qO - https://raw.githubusercontent.com/composer/getcomposer.org/fb22b78362d31c0d2bf516d1f8cdfd2745caa431/web/installer | php -- --install-dir=/usr/local/bin --filename=composer --quiet
151
+ - name : Install Symfony Flex
152
+ run : |
153
+ composer global require --prefer-dist --no-progress --no-suggest --ansi \
154
+ symfony/flex
155
+ - name : Remove Doctrine MongoDB ODM
156
+ if : matrix.php == '7.1'
157
+ run : |
158
+ composer remove --dev --no-progress --no-update --ansi \
159
+ doctrine/mongodb-odm \
160
+ doctrine/mongodb-odm-bundle \
161
+ - name : Update project dependencies
162
+ run : composer update --no-progress --no-suggest --ansi
163
+ - name : Clear test app cache
164
+ run : tests/Fixtures/app/console cache:clear --ansi
165
+ - name : Run PHPUnit tests
166
+ run : vendor/bin/phpunit --colors=always
167
+
168
+ phpunit-mysql :
169
+ name : PHPUnit (PHP ${{ matrix.php }}) (MySQL)
170
+ runs-on : ubuntu-latest
171
+ container :
172
+ image : php:${{ matrix.php }}-alpine
173
+ services :
174
+ mysql :
175
+ image : mysql:5.7
176
+ env :
177
+ MYSQL_DATABASE : api_platform_test
178
+ MYSQL_PASSWORD : LUhGR5tJ7WA2gbGumknCYBcB
179
+ MYSQL_RANDOM_ROOT_PASSWORD : ' yes'
180
+ MYSQL_USER : api-platform
181
+ options : --health-cmd "mysqladmin ping" --health-interval 10s --health-timeout 5s --health-retries 5
182
+ strategy :
183
+ matrix :
184
+ php :
185
+ - ' 7.3'
186
+ fail-fast : false
187
+ env :
188
+ APP_ENV : mysql
189
+ DATABASE_URL : mysql://api-platform:LUhGR5tJ7WA2gbGumknCYBcB@mysql/api_platform_test
190
+ steps :
191
+ - name : Checkout
192
+ uses : actions/checkout@v1
193
+ - name : Install system packages
194
+ run : |
195
+ apk add \
196
+ unzip \
197
+ - name : Install PHP extensions
198
+ run : |
199
+ apk add \
200
+ $PHPIZE_DEPS \
201
+ ;
202
+ docker-php-ext-install -j$(nproc) \
203
+ pdo_mysql \
204
+ ;
205
+ - name : Install mongodb PHP extension
206
+ if : matrix.php != '7.1'
207
+ run : |
208
+ apk add $PHPIZE_DEPS
209
+ pecl install mongodb-1.5.5
210
+ docker-php-ext-enable mongodb
211
+ - name : Disable PHP memory limit
212
+ run : echo 'memory_limit=-1' >> /usr/local/etc/php/php.ini
213
+ - name : Install Composer
214
+ run : wget -qO - https://raw.githubusercontent.com/composer/getcomposer.org/fb22b78362d31c0d2bf516d1f8cdfd2745caa431/web/installer | php -- --install-dir=/usr/local/bin --filename=composer --quiet
215
+ - name : Install Symfony Flex
216
+ run : |
217
+ composer global require --prefer-dist --no-progress --no-suggest --ansi \
218
+ symfony/flex
219
+ - name : Remove Doctrine MongoDB ODM
220
+ if : matrix.php == '7.1'
221
+ run : |
222
+ composer remove --dev --no-progress --no-update --ansi \
223
+ doctrine/mongodb-odm \
224
+ doctrine/mongodb-odm-bundle \
225
+ - name : Update project dependencies
226
+ run : composer update --no-progress --no-suggest --ansi
227
+ - name : Clear test app cache
228
+ run : tests/Fixtures/app/console cache:clear --ansi
229
+ - name : Run PHPUnit tests
230
+ run : vendor/bin/phpunit --colors=always
231
+
104
232
phpunit-no-deprecations :
105
233
name : PHPUnit (PHP ${{ matrix.php }}) (no deprecations)
106
234
runs-on : ubuntu-latest
0 commit comments