Skip to content

Commit 18473eb

Browse files
committed
Don't run phpunit tests on Travis
Since they're already run in the CI workflow on GitHub Actions
1 parent 749fb70 commit 18473eb

File tree

9 files changed

+126
-85
lines changed

9 files changed

+126
-85
lines changed

.circleci/config.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -204,8 +204,7 @@ executors:
204204
php-and-elasticsearch:
205205
docker:
206206
- image: circleci/php:7.3-node
207-
# https://github.com/elastic/elasticsearch-docker/issues/84
208-
- image: docker.elastic.co/elasticsearch/elasticsearch:6.7.2
207+
- image: docker.elastic.co/elasticsearch/elasticsearch:6.8.3 # https://github.com/elastic/elasticsearch/issues/43627
209208
php-and-mongodb:
210209
docker:
211210
- image: circleci/php:7.3-node
@@ -215,7 +214,7 @@ jobs:
215214
php-cs-fixer:
216215
executor: php
217216
environment:
218-
PHP_CS_FIXER_FUTURE_MODE: 1
217+
PHP_CS_FIXER_FUTURE_MODE: '1'
219218
working_directory: ~/api-platform/core
220219
steps:
221220
- checkout
@@ -239,8 +238,7 @@ jobs:
239238
phpstan:
240239
executor: php
241240
environment:
242-
# https://github.com/phpstan/phpstan-symfony/issues/37
243-
APP_DEBUG: 1
241+
APP_DEBUG: '1' # https://github.com/phpstan/phpstan-symfony/issues/37
244242
working_directory: ~/api-platform/core
245243
steps:
246244
- checkout

.github/workflows/ci.yml

Lines changed: 58 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,18 @@ name: CI
22

33
on:
44
push:
5-
# branches:
6-
# - master
7-
# - '[0-9]*.[0-9]*'
8-
# - '[0-9]*.x'
9-
# tags:
10-
# - 'v[0-9]*.[0-9]*'
115
pull_request:
126

7+
env:
8+
COMPOSER_ALLOW_SUPERUSER: '1' # https://getcomposer.org/doc/03-cli.md#composer-allow-superuser
9+
1310
jobs:
1411
phpunit:
1512
name: PHPUnit (PHP ${{ matrix.php }})
1613
runs-on: ubuntu-latest
1714
container:
18-
image: php:${{ matrix.php }}
15+
image: php:${{ matrix.php }}-alpine
1916
strategy:
20-
# https://i.8713187.xyzmunity/t5/GitHub-Actions/GitHub-Actions-Matrix-options-dont-work-as-documented/m-p/29558
2117
matrix:
2218
php:
2319
- '7.1'
@@ -30,24 +26,24 @@ jobs:
3026
uses: actions/checkout@v1
3127
- name: Install system packages
3228
run: |
33-
apt-get update
34-
apt-get install -y --no-install-recommends \
35-
unzip
29+
apk add \
30+
unzip \
3631
- name: Install mongodb PHP extension
3732
if: matrix.php != '7.1'
3833
run: |
34+
apk add $PHPIZE_DEPS
3935
pecl install mongodb-1.5.5
4036
docker-php-ext-enable mongodb
4137
- name: Disable PHP memory limit
4238
run: echo 'memory_limit=-1' >> /usr/local/etc/php/php.ini
4339
- name: Install Composer
44-
run: curl -sS -o - https://raw.githubusercontent.com/composer/getcomposer.org/ba13e3fc70f1c66250d1ea7ea4911d593aa1dba5/web/installer | php -- --install-dir=/usr/local/bin --filename=composer --quiet
40+
run: wget -qO - https://raw.githubusercontent.com/composer/getcomposer.org/fb22b78362d31c0d2bf516d1f8cdfd2745caa431/web/installer | php -- --install-dir=/usr/local/bin --filename=composer --quiet
4541
- name: Remove Doctrine MongoDB ODM
4642
if: matrix.php == '7.1'
4743
run: |
4844
composer remove --dev --no-progress --no-update --ansi \
4945
doctrine/mongodb-odm \
50-
doctrine/mongodb-odm-bundle
46+
doctrine/mongodb-odm-bundle \
5147
- name: Update project dependencies
5248
run: composer update --no-progress --no-suggest --ansi
5349
- name: Clear test app cache
@@ -59,9 +55,8 @@ jobs:
5955
name: PHPUnit (PHP ${{ matrix.php }}) (lowest dependencies)
6056
runs-on: ubuntu-latest
6157
container:
62-
image: php:${{ matrix.php }}
58+
image: php:${{ matrix.php }}-alpine
6359
strategy:
64-
# https://i.8713187.xyzmunity/t5/GitHub-Actions/GitHub-Actions-Matrix-options-dont-work-as-documented/m-p/29558
6560
matrix:
6661
php:
6762
- '7.3'
@@ -72,27 +67,70 @@ jobs:
7267
uses: actions/checkout@v1
7368
- name: Install system packages
7469
run: |
75-
apt-get update
76-
apt-get install -y --no-install-recommends \
77-
unzip
70+
apk add \
71+
unzip \
7872
- name: Install mongodb PHP extension
7973
if: matrix.php != '7.1'
8074
run: |
75+
apk add $PHPIZE_DEPS
8176
pecl install mongodb-1.5.5
8277
docker-php-ext-enable mongodb
8378
- name: Disable PHP memory limit
8479
run: echo 'memory_limit=-1' >> /usr/local/etc/php/php.ini
8580
- name: Install Composer
86-
run: curl -sS -o - https://raw.githubusercontent.com/composer/getcomposer.org/ba13e3fc70f1c66250d1ea7ea4911d593aa1dba5/web/installer | php -- --install-dir=/usr/local/bin --filename=composer --quiet
81+
run: wget -qO - https://raw.githubusercontent.com/composer/getcomposer.org/fb22b78362d31c0d2bf516d1f8cdfd2745caa431/web/installer | php -- --install-dir=/usr/local/bin --filename=composer --quiet
8782
- name: Remove Doctrine MongoDB ODM
8883
if: matrix.php == '7.1'
8984
run: |
9085
composer remove --dev --no-progress --no-update --ansi \
9186
doctrine/mongodb-odm \
92-
doctrine/mongodb-odm-bundle
87+
doctrine/mongodb-odm-bundle \
9388
- name: Update project dependencies
9489
run: composer update --no-progress --no-suggest --prefer-stable --prefer-lowest --ansi
9590
- name: Clear test app cache
9691
run: tests/Fixtures/app/console cache:clear --ansi
9792
- name: Run PHPUnit tests
9893
run: vendor/bin/phpunit --colors=always
94+
95+
phpunit-no-deprecations:
96+
name: PHPUnit (PHP ${{ matrix.php }}) (no deprecations)
97+
runs-on: ubuntu-latest
98+
container:
99+
image: php:${{ matrix.php }}-alpine
100+
strategy:
101+
matrix:
102+
php:
103+
- '7.3'
104+
fail-fast: false
105+
env:
106+
SYMFONY_DEPRECATIONS_HELPER: max[total]=5 # 5 deprecation notices from FOSUserBundle
107+
steps:
108+
- name: Checkout
109+
uses: actions/checkout@v1
110+
- name: Install system packages
111+
run: |
112+
apk add \
113+
unzip \
114+
- name: Install mongodb PHP extension
115+
if: matrix.php != '7.1'
116+
run: |
117+
apk add $PHPIZE_DEPS
118+
pecl install mongodb-1.5.5
119+
docker-php-ext-enable mongodb
120+
- name: Disable PHP memory limit
121+
run: echo 'memory_limit=-1' >> /usr/local/etc/php/php.ini
122+
- name: Install Composer
123+
run: wget -qO - https://raw.githubusercontent.com/composer/getcomposer.org/fb22b78362d31c0d2bf516d1f8cdfd2745caa431/web/installer | php -- --install-dir=/usr/local/bin --filename=composer --quiet
124+
- name: Remove Doctrine MongoDB ODM
125+
if: matrix.php == '7.1'
126+
run: |
127+
composer remove --dev --no-progress --no-update --ansi \
128+
doctrine/mongodb-odm \
129+
doctrine/mongodb-odm-bundle \
130+
- name: Update project dependencies
131+
run: composer update --no-progress --no-suggest --ansi
132+
- name: Clear test app cache
133+
run: tests/Fixtures/app/console cache:clear --ansi
134+
- name: Run PHPUnit tests
135+
run: vendor/bin/phpunit --colors=always
136+
continue-on-error: true

.travis.yml

Lines changed: 40 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ cache:
66
- $HOME/.npm
77

88
.steps:
9-
- &add-composer-bin-dir-to-path |
10-
export PATH="$PATH:$HOME/.composer/vendor/bin"
119
- &clear-test-app-cache |
1210
tests/Fixtures/app/console cache:clear
1311
- &disable-php-memory-limit |
@@ -33,13 +31,11 @@ cache:
3331

3432
jobs:
3533
include:
36-
- name: '(PHP 7.1)'
34+
- name: 'Behat (PHP 7.1)'
3735
php: '7.1'
3836
before_install:
39-
- *enable-mongodb-php-extension
4037
- *disable-xdebug-php-extension
4138
- *disable-php-memory-limit
42-
- *add-composer-bin-dir-to-path
4339
install:
4440
- |
4541
composer remove --dev --no-progress --no-update --ansi \
@@ -49,74 +45,99 @@ jobs:
4945
before_script:
5046
- *clear-test-app-cache
5147
script:
52-
- *run-phpunit-tests
53-
- *clear-test-app-cache
5448
- *run-behat-tests
5549
- *validate-openapi-v2-json
5650
- *validate-openapi-v2-yaml
5751
- *validate-openapi-v3-json
5852
- *validate-openapi-v3-yaml
5953

60-
- name: '(PHP 7.2)'
54+
- name: 'Behat (PHP 7.2)'
6155
php: '7.2'
6256
before_install:
6357
- *enable-mongodb-php-extension
6458
- *disable-xdebug-php-extension
6559
- *disable-php-memory-limit
66-
- *add-composer-bin-dir-to-path
6760
install:
6861
- *update-project-dependencies
6962
before_script:
7063
- *clear-test-app-cache
7164
script:
72-
- *run-phpunit-tests
73-
- *clear-test-app-cache
7465
- *run-behat-tests
7566
- *validate-openapi-v2-json
7667
- *validate-openapi-v2-yaml
7768
- *validate-openapi-v3-json
7869
- *validate-openapi-v3-yaml
7970

80-
- name: '(PHP 7.3)'
71+
- name: 'Behat (PHP 7.3)'
8172
php: '7.3'
8273
before_install:
8374
- *enable-mongodb-php-extension
8475
- *disable-xdebug-php-extension
8576
- *disable-php-memory-limit
86-
- *add-composer-bin-dir-to-path
8777
install:
8878
- *update-project-dependencies
8979
before_script:
9080
- *clear-test-app-cache
9181
script:
92-
- *run-phpunit-tests
93-
- *clear-test-app-cache
9482
- *run-behat-tests
9583
- *validate-openapi-v2-json
9684
- *validate-openapi-v2-yaml
9785
- *validate-openapi-v3-json
9886
- *validate-openapi-v3-yaml
9987

100-
- name: '(PHP 7.3) (lowest dependencies)'
88+
- name: 'Behat (PHP 7.4-rc)'
89+
php: '7.4snapshot'
90+
env: LEGACY=0
91+
before_install:
92+
- *enable-mongodb-php-extension
93+
- *disable-xdebug-php-extension
94+
- *disable-php-memory-limit
95+
install:
96+
- *update-project-dependencies
97+
before_script:
98+
- *clear-test-app-cache
99+
script:
100+
- vendor/bin/behat --format=progress --profile=default-no-legacy --no-interaction --colors
101+
- *validate-openapi-v2-json
102+
- *validate-openapi-v2-yaml
103+
- *validate-openapi-v3-json
104+
- *validate-openapi-v3-yaml
105+
106+
- name: 'Behat (PHP 7.3) (lowest dependencies)'
101107
php: '7.3'
102108
before_install:
103109
- *enable-mongodb-php-extension
104110
- *disable-xdebug-php-extension
105111
- *disable-php-memory-limit
106-
- *add-composer-bin-dir-to-path
107112
install:
108113
- composer update --no-progress --no-suggest --prefer-stable --prefer-lowest --ansi
109114
before_script:
110115
- *clear-test-app-cache
111116
script:
112-
- *run-phpunit-tests
113-
- *clear-test-app-cache
114117
- *run-behat-tests
115118
- *validate-openapi-v2-json
116119
- *validate-openapi-v2-yaml
117120
- *validate-openapi-v3-json
118121
- *validate-openapi-v3-yaml
119122

123+
- name: 'Behat (PHP 7.4-rc) (lowest dependencies)'
124+
php: '7.4snapshot'
125+
env: LEGACY=0
126+
before_install:
127+
- *enable-mongodb-php-extension
128+
- *disable-xdebug-php-extension
129+
- *disable-php-memory-limit
130+
install:
131+
- composer update --no-progress --no-suggest --prefer-stable --prefer-lowest --ansi
132+
before_script:
133+
- *clear-test-app-cache
134+
script:
135+
- vendor/bin/behat --format=progress --profile=default-no-legacy --no-interaction --colors
136+
- *validate-openapi-v2-json
137+
- *validate-openapi-v2-yaml
138+
- *validate-openapi-v3-json
139+
- *validate-openapi-v3-yaml
140+
120141
- php: '7.3'
121142
env: APP_ENV=postgres
122143
services:
@@ -125,7 +146,6 @@ jobs:
125146
- *enable-mongodb-php-extension
126147
- *disable-xdebug-php-extension
127148
- *disable-php-memory-limit
128-
- *add-composer-bin-dir-to-path
129149
install:
130150
- *update-project-dependencies
131151
before_script:
@@ -148,7 +168,6 @@ jobs:
148168
- *enable-mongodb-php-extension
149169
- *disable-xdebug-php-extension
150170
- *disable-php-memory-limit
151-
- *add-composer-bin-dir-to-path
152171
install:
153172
- *update-project-dependencies
154173
before_script:
@@ -171,7 +190,6 @@ jobs:
171190
- *enable-mongodb-php-extension
172191
- *disable-xdebug-php-extension
173192
- *disable-php-memory-limit
174-
- *add-composer-bin-dir-to-path
175193
install:
176194
- *update-project-dependencies
177195
before_script:
@@ -197,7 +215,6 @@ jobs:
197215
- *enable-mongodb-php-extension
198216
- *disable-xdebug-php-extension
199217
- *disable-php-memory-limit
200-
- *add-composer-bin-dir-to-path
201218
install:
202219
- *update-project-dependencies
203220
before_script:
@@ -211,26 +228,4 @@ jobs:
211228
- *validate-openapi-v3-json
212229
- *validate-openapi-v3-yaml
213230

214-
- php: '7.3'
215-
env: SYMFONY_DEPRECATIONS_HELPER=max[total]=5 # 5 deprecation notices from FOSUserBundle
216-
before_install:
217-
- *enable-mongodb-php-extension
218-
- *disable-xdebug-php-extension
219-
- *disable-php-memory-limit
220-
- *add-composer-bin-dir-to-path
221-
install:
222-
- *update-project-dependencies
223-
before_script:
224-
- *clear-test-app-cache
225-
script:
226-
- *run-phpunit-tests
227-
- *clear-test-app-cache
228-
- *run-behat-tests
229-
- *validate-openapi-v2-json
230-
- *validate-openapi-v2-yaml
231-
- *validate-openapi-v3-json
232-
- *validate-openapi-v3-yaml
233-
234-
allow_failures:
235-
- env: SYMFONY_DEPRECATIONS_HELPER=max[total]=5 # 5 deprecation notices from FOSUserBundle
236231
fast_finish: true

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ It natively supports popular open formats including [JSON for Linked Data (JSON-
99
Build a working and fully-featured CRUD API in minutes. Leverage the awesome features of the tool to develop complex and
1010
high performance API-first projects. Extend or override everything you want.
1111

12+
[![GitHub Actions](https://github.com/api-platform/core/workflows/CI/badge.svg)](https://github.com/api-platform/core/actions?workflow=CI)
1213
[![Travis CI](https://travis-ci.org/api-platform/core.svg?branch=master)](https://travis-ci.org/api-platform/core)
1314
[![CircleCI](https://circleci.com/gh/api-platform/core/tree/master.svg?style=shield)](https://circleci.com/gh/api-platform/core/tree/master)
1415
[![AppVeyor](https://ci.appveyor.com/api/projects/status/grwuyprts3wdqx5l/branch/master?svg=true)](https://ci.appveyor.com/project/dunglas/dunglasapibundle/branch/master)

behat.yml.dist

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@ default:
3434
symfony2: ~
3535
'Behatch\Extension': ~
3636

37+
default-no-legacy:
38+
suites:
39+
default:
40+
filters:
41+
tags: '~@postgres&&~@mongodb&&~@elasticsearch&&~@legacy'
42+
3743
postgres:
3844
suites:
3945
default: false

0 commit comments

Comments
 (0)