Skip to content

Commit 262db21

Browse files
authored
Merge pull request #89 from jrushlow/ci/add-symfony-matrix
test bundle across all supported symfony versions
2 parents 5eeaee7 + a70674f commit 262db21

File tree

3 files changed

+106
-4
lines changed

3 files changed

+106
-4
lines changed

.github/workflows/ci.yml

Lines changed: 105 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,64 @@ jobs:
4545
- name: Analyze Source
4646
run: vendor/bin/psalm -c $GITHUB_WORKSPACE/psalm.xml
4747

48-
phpunit-tests:
49-
name: PHPUnit Test Suite
48+
stable-tests:
49+
name: Test against Symfony Stable
50+
runs-on: ubuntu-latest
51+
52+
strategy:
53+
fail-fast: false
54+
matrix:
55+
php-versions: ['7.2', '7.3', '7.4']
56+
symfony-version: ['4.4.*', '5.0.*']
57+
58+
steps:
59+
- name: Set PHP Version
60+
run: sudo update-alternatives --set php /usr/bin/php${{ matrix.php-versions }}
61+
62+
- name: Disable Xdebug
63+
run: sudo rm /etc/php/${{ matrix.php-versions }}/cli/conf.d/20-xdebug.ini
64+
65+
- name: Get PHP Version
66+
run: |
67+
ver=$(php -v | grep -oP '(?<=PHP )\d.\d')
68+
echo "::set-output name=version::$ver"
69+
id: php-ver
70+
71+
- name: Using PHP Version from matrix
72+
run: |
73+
echo "Runner is not using PHP Version defined in the php-versions matrix."
74+
php -v
75+
exit 1
76+
if: steps.php-ver.outputs.version != matrix.php-versions
77+
78+
- name: Checkout
79+
uses: actions/[email protected]
80+
81+
- name: Install Global Dependencies
82+
run: |
83+
composer global require --no-progress --no-scripts --no-plugins symfony/flex dev-master
84+
85+
- name: Install dependencies
86+
run: |
87+
composer config minimum-stability stable
88+
composer install --prefer-dist --no-progress --no-suggest
89+
env:
90+
SYMFONY_REQUIRE: ${{ matrix.symfony-version }}
91+
92+
- name: Unit Tests
93+
run: vendor/bin/simple-phpunit -c $GITHUB_WORKSPACE/phpunit.xml.dist --testsuite unit
94+
if: always()
95+
96+
- name: Functional Tests
97+
run: vendor/bin/simple-phpunit -c $GITHUB_WORKSPACE/phpunit.xml.dist --testsuite functional
98+
if: always()
99+
100+
- name: Integration Tests
101+
run: vendor/bin/simple-phpunit -c $GITHUB_WORKSPACE/phpunit.xml.dist --testsuite integration
102+
if: always()
103+
104+
dev-master-tests:
105+
name: Test against Symfony Master
50106
runs-on: ubuntu-latest
51107

52108
strategy:
@@ -91,3 +147,50 @@ jobs:
91147
- name: Integration Tests
92148
run: vendor/bin/simple-phpunit -c $GITHUB_WORKSPACE/phpunit.xml.dist --testsuite integration
93149
if: always()
150+
151+
lowest-version-tests:
152+
name: Test with lowest dependency versions
153+
runs-on: ubuntu-latest
154+
155+
strategy:
156+
fail-fast: false
157+
matrix:
158+
php-versions: ['7.2', '7.3', '7.4']
159+
160+
steps:
161+
- name: Set PHP Version
162+
run: sudo update-alternatives --set php /usr/bin/php${{ matrix.php-versions }}
163+
164+
- name: Disable Xdebug
165+
run: sudo rm /etc/php/${{ matrix.php-versions }}/cli/conf.d/20-xdebug.ini
166+
167+
- name: Get PHP Version
168+
run: |
169+
ver=$(php -v | grep -oP '(?<=PHP )\d.\d')
170+
echo "::set-output name=version::$ver"
171+
id: php-ver
172+
173+
- name: Using PHP Version from matrix
174+
run: |
175+
echo "Runner is not using PHP Version defined in the php-versions matrix."
176+
php -v
177+
exit 1
178+
if: steps.php-ver.outputs.version != matrix.php-versions
179+
180+
- name: Checkout
181+
uses: actions/[email protected]
182+
183+
- name: Install dependencies
184+
run: composer update --prefer-lowest --prefer-dist --no-progress --no-suggest
185+
186+
- name: Unit Tests
187+
run: vendor/bin/simple-phpunit -c $GITHUB_WORKSPACE/phpunit.xml.dist --testsuite unit
188+
if: always()
189+
190+
- name: Functional Tests
191+
run: vendor/bin/simple-phpunit -c $GITHUB_WORKSPACE/phpunit.xml.dist --testsuite functional
192+
if: always()
193+
194+
- name: Integration Tests
195+
run: vendor/bin/simple-phpunit -c $GITHUB_WORKSPACE/phpunit.xml.dist --testsuite integration
196+
if: always()

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"require-dev": {
1414
"doctrine/orm": "^2.7",
1515
"friendsofphp/php-cs-fixer": "^2.16",
16-
"symfony/framework-bundle": "^5.0",
16+
"symfony/framework-bundle": "^4.4 | ^5.0",
1717
"symfony/phpunit-bridge": "^5.0",
1818
"vimeo/psalm": "^3.8",
1919
"doctrine/doctrine-bundle": "^2.0"

tests/Fixtures/AbstractResetPasswordTestKernel.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ protected function configureContainer(ContainerBuilder $container, LoaderInterfa
8585
],
8686
'orm' => [
8787
'auto_generate_proxy_classes' => true,
88-
'naming_strategy' => 'doctrine.orm.naming_strategy.underscore_number_aware',
8988
'auto_mapping' => true,
9089
'mappings' => [
9190
'App' => [

0 commit comments

Comments
 (0)