Skip to content

Commit 6a4bd24

Browse files
authored
add PHP 8 support in CI / dev environments (#137)
1 parent b1002d2 commit 6a4bd24

File tree

4 files changed

+35
-32
lines changed

4 files changed

+35
-32
lines changed

.github/workflows/ci.yml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,13 @@ jobs:
2222
runs-on: ubuntu-latest
2323

2424
steps:
25+
- name: Set PHP Version
26+
run: sudo update-alternatives --set php /usr/bin/php7.4
2527
- name: Checkout
2628
uses: actions/[email protected]
2729

2830
- name: Install PHP-CS-Fixer
29-
run: composer global require friendsofphp/php-cs-fixer --prefer-dist --no-progress --no-suggest
31+
run: composer global require friendsofphp/php-cs-fixer --prefer-dist --no-progress
3032

3133
- name: Enforce coding standards
3234
run: $HOME/.composer/vendor/bin/php-cs-fixer fix --config $GITHUB_WORKSPACE/.php_cs.dist --diff --diff-format udiff --dry-run
@@ -36,11 +38,14 @@ jobs:
3638
runs-on: ubuntu-latest
3739

3840
steps:
41+
- name: Set PHP Version
42+
run: sudo update-alternatives --set php /usr/bin/php7.4
43+
3944
- name: Checkout
4045
uses: actions/[email protected]
4146

4247
- name: Install dependencies
43-
run: composer install --prefer-dist --no-progress --no-suggest
48+
run: composer install --prefer-dist --no-progress
4449

4550
- name: Analyze Source
4651
run: vendor/bin/psalm -c $GITHUB_WORKSPACE/psalm.xml
@@ -53,7 +58,7 @@ jobs:
5358
fail-fast: false
5459
matrix:
5560
php-versions: ['7.2', '7.3', '7.4', '8.0']
56-
symfony-version: ['4.4.*', '5.0.*', '5.1.*', '5.2.*']
61+
symfony-version: ['4.4.*', '5.2.*']
5762

5863
steps:
5964
- name: Set PHP Version
@@ -85,7 +90,7 @@ jobs:
8590
- name: Install dependencies
8691
run: |
8792
composer config minimum-stability stable
88-
composer install --prefer-dist --no-progress --no-suggest
93+
composer update --prefer-dist --no-progress
8994
env:
9095
SYMFONY_REQUIRE: ${{ matrix.symfony-version }}
9196

@@ -134,7 +139,7 @@ jobs:
134139
uses: actions/[email protected]
135140

136141
- name: Install dependencies
137-
run: composer install --prefer-dist --no-progress --no-suggest
142+
run: composer update --prefer-dist --no-progress
138143

139144
- name: Unit Tests
140145
run: vendor/bin/simple-phpunit -c $GITHUB_WORKSPACE/phpunit.xml.dist --testsuite unit
@@ -181,7 +186,7 @@ jobs:
181186
uses: actions/[email protected]
182187

183188
- name: Install dependencies
184-
run: composer update --prefer-lowest --prefer-dist --no-progress --no-suggest
189+
run: composer update --prefer-lowest --prefer-dist --no-progress
185190

186191
- name: Unit Tests
187192
run: vendor/bin/simple-phpunit -c $GITHUB_WORKSPACE/phpunit.xml.dist --testsuite unit

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
},
1313
"require-dev": {
1414
"doctrine/orm": "^2.7",
15-
"friendsofphp/php-cs-fixer": "^2.16",
15+
"friendsofphp/php-cs-fixer": "^2.17",
1616
"symfony/framework-bundle": "^4.4 | ^5.0",
1717
"symfony/phpunit-bridge": "^5.0",
18-
"vimeo/psalm": "^3.8",
18+
"vimeo/psalm": "^4.3",
1919
"doctrine/doctrine-bundle": "^2.0.3"
2020
},
2121
"conflict": {

phpunit.xml.dist

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,31 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
32
<!-- https://phpunit.readthedocs.io/en/latest/configuration.html -->
4-
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5-
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/8.3/phpunit.xsd"
6-
backupGlobals="false"
7-
colors="true"
8-
bootstrap="vendor/autoload.php"
3+
<phpunit
4+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
6+
backupGlobals="false"
7+
colors="true"
8+
bootstrap="vendor/autoload.php"
99
>
10+
1011
<php>
11-
<ini name="error_reporting" value="-1" />
12-
<server name="SHELL_VERBOSITY" value="-1" />
13-
<server name="SYMFONY_PHPUNIT_REMOVE" value="" />
14-
<server name="SYMFONY_PHPUNIT_VERSION" value="8.3" />
12+
<ini name="error_reporting" value="-1"/>
13+
<server name="SHELL_VERBOSITY" value="-1"/>
14+
<server name="SYMFONY_PHPUNIT_REMOVE" value=""/>
1515
<env name="SYMFONY_DEPRECATIONS_HELPER" value="max[self]=0"/>
1616
</php>
1717

18+
<coverage processUncoveredFiles="true">
19+
<include>
20+
<directory suffix=".php">./src/</directory>
21+
</include>
22+
<exclude>
23+
<directory>./src/Resources</directory>
24+
<directory>./tests</directory>
25+
<directory>./vendor</directory>
26+
</exclude>
27+
</coverage>
28+
1829
<testsuites>
1930
<testsuite name="all">
2031
<directory>./tests</directory>
@@ -29,19 +40,7 @@
2940
<directory>./tests/IntegrationTests</directory>
3041
</testsuite>
3142
</testsuites>
32-
33-
<filter>
34-
<whitelist processUncoveredFilesFromWhitelist="true">
35-
<directory suffix=".php">./src/</directory>
36-
<exclude>
37-
<directory>./src/Resources</directory>
38-
<directory>./tests</directory>
39-
<directory>./vendor</directory>
40-
</exclude>
41-
</whitelist>
42-
</filter>
43-
4443
<listeners>
45-
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener" />
44+
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener"/>
4645
</listeners>
4746
</phpunit>

psalm.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
<MissingReturnType errorLevel="info"/>
3636
<MissingPropertyType errorLevel="info"/>
3737
<InvalidDocblock errorLevel="info"/>
38-
<MisplacedRequiredParam errorLevel="info"/>
3938

4039
<PropertyNotSetInConstructor errorLevel="info"/>
4140
<MissingConstructor errorLevel="info"/>

0 commit comments

Comments
 (0)