Skip to content

Commit c490b0f

Browse files
committed
Add CI jobs for testing next release of Symfony
1 parent 0955fc5 commit c490b0f

File tree

2 files changed

+157
-6
lines changed

2 files changed

+157
-6
lines changed

.github/workflows/ci.yml

Lines changed: 156 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ env:
1111
EXT_MONGODB_VERSION: '1.5.5'
1212
EXT_PCOV_VERSION: '1.0.6'
1313
LEGACY: '0'
14-
SYMFONY_REQUIRE: ^3.4 || ^4.0
14+
SYMFONY_REQUIRE: ^3.4 || ^4.0 || ^5.0
1515

1616
jobs:
1717
phpunit:
@@ -173,7 +173,7 @@ jobs:
173173
run: |
174174
mkdir -p /tmp/api-platform/core/var
175175
ln -s /tmp/api-platform/core/var tests/Fixtures/app/var
176-
tests/Fixtures/app/console cache:clear --
176+
tests/Fixtures/app/console cache:clear --ansi
177177
- name: Enable code coverage
178178
if: matrix.coverage
179179
run: echo '::set-env name=COVERAGE::1'
@@ -1018,7 +1018,7 @@ jobs:
10181018
run: |
10191019
mkdir -p /tmp/api-platform/core/var
10201020
ln -s /tmp/api-platform/core/var tests/Fixtures/app/var
1021-
tests/Fixtures/app/console cache:clear --
1021+
tests/Fixtures/app/console cache:clear --ansi
10221022
- name: Enable code coverage
10231023
if: matrix.coverage
10241024
run: echo '::set-env name=COVERAGE::1'
@@ -1107,10 +1107,162 @@ jobs:
11071107
run: |
11081108
mkdir -p build/logs/phpunit
11091109
vendor/bin/phpunit --log-junit build/logs/phpunit/junit.xml --colors=always
1110-
continue-on-error: true
11111110
- name: Upload test artifacts
11121111
if: always()
11131112
uses: actions/upload-artifact@v1
11141113
with:
11151114
name: phpunit-logs-php${{ matrix.php }}-no-deprecations
11161115
path: build/logs/phpunit
1116+
1117+
phpunit-symfony-next:
1118+
name: PHPUnit (PHP ${{ matrix.php }}) (Symfony ${{ matrix.symfony }})
1119+
runs-on: ubuntu-latest
1120+
container:
1121+
image: php:${{ matrix.php }}-alpine
1122+
options: >-
1123+
--tmpfs /tmp:exec
1124+
strategy:
1125+
matrix:
1126+
php:
1127+
- '7.3'
1128+
symfony:
1129+
- '4.4'
1130+
fail-fast: false
1131+
timeout-minutes: 20
1132+
steps:
1133+
- name: Checkout
1134+
uses: actions/checkout@v1
1135+
- name: Install system packages
1136+
run: |
1137+
apk add \
1138+
jq \
1139+
moreutils \
1140+
unzip \
1141+
- name: Install mongodb PHP extension
1142+
run: |
1143+
apk add $PHPIZE_DEPS
1144+
pecl install mongodb-$EXT_MONGODB_VERSION
1145+
docker-php-ext-enable mongodb
1146+
- name: Disable PHP memory limit
1147+
run: echo 'memory_limit=-1' >> /usr/local/etc/php/php.ini
1148+
- name: Install Composer
1149+
run: wget -qO - https://raw.githubusercontent.com/composer/getcomposer.org/$COMPOSER_INSTALLER_COMMIT/web/installer | php -- --install-dir=/usr/local/bin --filename=composer --quiet
1150+
- name: Install Symfony Flex
1151+
run: |
1152+
composer global require --prefer-dist --no-progress --no-suggest --ansi \
1153+
symfony/flex
1154+
- name: Allow unstable project dependencies
1155+
run: |
1156+
jq '. + {"minimum-stability": "dev"}' composer.json | sponge composer.json
1157+
- name: Update project dependencies
1158+
run: |
1159+
mkdir -p /tmp/api-platform/core/vendor
1160+
ln -s /tmp/api-platform/core/vendor vendor
1161+
composer update --no-progress --no-suggest --ansi
1162+
- name: Flag held back Symfony packages
1163+
env:
1164+
symfony_version: ${{ matrix.symfony }}
1165+
run: |
1166+
version_pattern=$symfony_version.x-dev
1167+
if [ "${symfony_version%.4}" != "$symfony_version" ]; then
1168+
current_major=${symfony_version%.4}
1169+
next_major=$((current_major + 1))
1170+
version_pattern=$version_pattern'|'$next_major.0.x-dev'|'dev-master
1171+
fi
1172+
version_pattern=$(echo "$version_pattern" | sed -r 's/\./\\./g')
1173+
symfony_packages=$(composer show symfony/* | tr -s ' ' '\t' | cut -f1-2 | grep -vE 'polyfill|contracts|mercure')
1174+
! echo "$symfony_packages" | grep -vE "$version_pattern"
1175+
continue-on-error: true
1176+
- name: Clear test app cache
1177+
run: |
1178+
mkdir -p /tmp/api-platform/core/var
1179+
ln -s /tmp/api-platform/core/var tests/Fixtures/app/var
1180+
tests/Fixtures/app/console cache:clear --ansi
1181+
- name: Run PHPUnit tests
1182+
run: |
1183+
mkdir -p build/logs/phpunit
1184+
vendor/bin/phpunit --log-junit build/logs/phpunit/junit.xml --colors=always
1185+
- name: Upload test artifacts
1186+
if: always()
1187+
uses: actions/upload-artifact@v1
1188+
with:
1189+
name: phpunit-logs-php${{ matrix.php }}-symfony${{ matrix.symfony }}
1190+
path: build/logs/phpunit
1191+
1192+
behat-symfony-next:
1193+
name: Behat (PHP ${{ matrix.php }}) (Symfony ${{ matrix.symfony }})
1194+
runs-on: ubuntu-latest
1195+
container:
1196+
image: php:${{ matrix.php }}-alpine
1197+
options: >-
1198+
--tmpfs /tmp:exec
1199+
strategy:
1200+
matrix:
1201+
php:
1202+
- '7.3'
1203+
symfony:
1204+
- '4.4'
1205+
fail-fast: false
1206+
timeout-minutes: 20
1207+
steps:
1208+
- name: Checkout
1209+
uses: actions/checkout@v1
1210+
- name: Install system packages
1211+
run: |
1212+
apk add \
1213+
jq \
1214+
moreutils \
1215+
unzip \
1216+
- name: Install mongodb PHP extension
1217+
run: |
1218+
apk add $PHPIZE_DEPS
1219+
pecl install mongodb-$EXT_MONGODB_VERSION
1220+
docker-php-ext-enable mongodb
1221+
- name: Disable PHP memory limit
1222+
run: echo 'memory_limit=-1' >> /usr/local/etc/php/php.ini
1223+
- name: Install Composer
1224+
run: wget -qO - https://raw.githubusercontent.com/composer/getcomposer.org/$COMPOSER_INSTALLER_COMMIT/web/installer | php -- --install-dir=/usr/local/bin --filename=composer --quiet
1225+
- name: Install Symfony Flex
1226+
run: |
1227+
composer global require --prefer-dist --no-progress --no-suggest --ansi \
1228+
symfony/flex
1229+
- name: Allow unstable project dependencies
1230+
run: |
1231+
jq '. + {"minimum-stability": "dev"}' composer.json | sponge composer.json
1232+
- name: Update project dependencies
1233+
run: |
1234+
mkdir -p /tmp/api-platform/core/vendor
1235+
ln -s /tmp/api-platform/core/vendor vendor
1236+
composer update --no-progress --no-suggest --ansi
1237+
- name: Flag held back Symfony packages
1238+
env:
1239+
symfony_version: ${{ matrix.symfony }}
1240+
run: |
1241+
version_pattern=$symfony_version.x-dev
1242+
if [ "${symfony_version%.4}" != "$symfony_version" ]; then
1243+
current_major=${symfony_version%.4}
1244+
next_major=$((current_major + 1))
1245+
version_pattern=$version_pattern'|'$next_major.0.x-dev'|'dev-master
1246+
fi
1247+
version_pattern=$(echo "$version_pattern" | sed -r 's/\./\\./g')
1248+
symfony_packages=$(composer show symfony/* | tr -s ' ' '\t' | cut -f1-2 | grep -vE 'polyfill|contracts|mercure')
1249+
! echo "$symfony_packages" | grep -vE "$version_pattern"
1250+
continue-on-error: true
1251+
- name: Enable legacy integrations
1252+
if: startsWith(matrix.php, '7.3')
1253+
run: echo '::set-env name=LEGACY::1'
1254+
- name: Clear test app cache
1255+
run: |
1256+
mkdir -p /tmp/api-platform/core/var
1257+
ln -s /tmp/api-platform/core/var tests/Fixtures/app/var
1258+
tests/Fixtures/app/console cache:clear --ansi
1259+
- name: Run Behat tests
1260+
run: |
1261+
mkdir -p build/logs/behat
1262+
vendor/bin/behat --format=progress --out=std --format=junit --out=build/logs/behat/junit --profile="$(if [ "$LEGACY" = '1' ]; then echo 'default-legacy'; else echo 'default'; fi)" --no-interaction --colors
1263+
- name: Upload test artifacts
1264+
if: always()
1265+
uses: actions/upload-artifact@v1
1266+
with:
1267+
name: behat-logs-php${{ matrix.php }}-symfony${{ matrix.symfony }}
1268+
path: build/logs/behat

composer.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,5 @@
129129
"branch-alias": {
130130
"dev-master": "2.5.x-dev"
131131
}
132-
},
133-
"minimum-stability": "dev"
132+
}
134133
}

0 commit comments

Comments
 (0)