Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4f79cd2

Browse files
Yozhefste93cry
andauthored
Update the CI to test against Symfony 5.x and PHP 8.1 (getsentry#410)
Co-authored-by: Stefano Arlandini <[email protected]>
1 parent 241fc0c commit 4f79cd2

File tree

2 files changed

+71
-80
lines changed

2 files changed

+71
-80
lines changed

.github/workflows/tests.yaml

Lines changed: 70 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: CI
1+
name: Continuous Integration
22

33
on:
44
pull_request: null
@@ -9,87 +9,91 @@ on:
99
- 3.5.x
1010

1111
jobs:
12-
Tests:
12+
tests:
13+
name: Tests
1314
runs-on: ubuntu-latest
14-
continue-on-error: ${{ matrix.experimental == true }}
1515
env:
16-
SYMFONY_REQUIRE: ${{matrix.symfony_constraint}}
16+
SYMFONY_REQUIRE: ${{ matrix.symfony-version }}
1717
strategy:
1818
fail-fast: false
1919
matrix:
2020
php:
21-
- '8.1'
22-
- '8.0'
23-
- '7.4'
24-
- '7.3'
2521
- '7.2'
26-
sentry_constraint: [false]
27-
dbal_constraint: [false]
28-
symfony_constraint: ['']
29-
experimental: [false]
22+
- '7.3'
23+
- '7.4'
24+
- '8.0'
25+
- '8.1'
26+
symfony-version:
27+
- 3.4.*
28+
- 4.4.*
29+
- 5.*
30+
dependencies:
31+
- highest
32+
exclude:
33+
- php: '8.0'
34+
symfony-version: 3.4.*
35+
- php: '8.1'
36+
symfony-version: 3.4.*
3037
include:
31-
# - description: 'sentry/sentry dev-develop'
32-
# php: '7.4'
33-
# sentry_constraint: 'dev-develop'
34-
# experimental: true
35-
- description: 'DBAL 2'
36-
php: '7.4'
37-
dbal_constraint: '^2.13'
38-
- description: 'Symfony 4.4'
39-
php: '7.3'
40-
symfony_constraint: 4.4.*
41-
- description: 'Symfony 3.4'
42-
php: '7.2'
43-
symfony_constraint: 3.4.*
44-
env:
45-
SYMFONY_DEPRECATIONS_HELPER: disabled
46-
- description: 'prefer lowest'
47-
php: '7.2'
48-
composer_option: '--prefer-lowest'
49-
symfony_constraint: ^3.4.44
50-
env:
51-
SYMFONY_DEPRECATIONS_HELPER: disabled
52-
53-
name: PHP ${{ matrix.php }} tests (${{ matrix.description }})
38+
- php: '7.2'
39+
symfony-version: 3.4.*
40+
dependencies: lowest
41+
- php: '7.2'
42+
symfony-version: 4.4.*
43+
dependencies: lowest
44+
- php: '7.2'
45+
symfony-version: 5.*
46+
dependencies: lowest
47+
5448
steps:
55-
- uses: actions/checkout@v2
49+
- name: Checkout
50+
uses: actions/checkout@v2
5651
with:
5752
fetch-depth: 2
58-
- uses: actions/cache@v2
59-
with:
60-
path: ~/.composer/cache/files
61-
key: ${{ matrix.php }}-${{ matrix.symfony_constraint }}-${{ matrix.composer_option }}
62-
- uses: shivammathur/setup-php@v2
53+
54+
- name: Setup PHP
55+
uses: shivammathur/setup-php@v2
6356
with:
6457
php-version: ${{ matrix.php }}
65-
coverage: xdebug
66-
- name: Install Symfony Flex
67-
run: composer global require --no-progress --no-scripts --no-plugins symfony/flex
68-
- run: composer remove --dev symfony/messenger --no-update
69-
if: matrix.symfony_constraint == '3.4.*' || matrix.composer_option == '--prefer-lowest'
70-
- run: composer require --dev doctrine/dbal ${{ matrix.dbal_constraint }} --no-update
71-
if: matrix.dbal_constraint
72-
- run: composer update --no-progress --ansi ${{ matrix.composer_option }}
73-
- run: composer require sentry/sentry dev-develop
74-
if: matrix.sentry_constraint == 'dev-develop'
75-
- run: vendor/bin/phpunit --coverage-clover=coverage.xml
76-
- uses: codecov/codecov-action@v1
58+
coverage: pcov
59+
tools: flex
60+
61+
- name: Setup Problem Matchers for PHPUnit
62+
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
63+
64+
- name: Remove Symfony Messenger
65+
run: composer remove --dev symfony/messenger --no-update
66+
if: matrix.symfony-version == '3.4.*'
67+
68+
- name: Install dependencies
69+
uses: ramsey/composer-install@v1
7770
with:
78-
file: './coverage.xml'
79-
fail_ci_if_error: true
71+
dependency-versions: ${{ matrix.dependencies }}
72+
composer-options: --prefer-dist
73+
74+
- name: Run tests
75+
run: vendor/bin/phpunit --coverage-clover=build/coverage-report.xml
76+
77+
- name: Upload code coverage
78+
uses: codecov/codecov-action@v1
79+
with:
80+
file: build/coverage-report.xml
8081

8182
missing-optional-packages-tests:
8283
name: Tests without optional packages
8384
runs-on: ubuntu-latest
8485
strategy:
8586
fail-fast: false
8687
matrix:
87-
php:
88-
- '7.2'
89-
- '8.0'
90-
dependencies:
91-
- lowest
92-
- highest
88+
include:
89+
- php: '7.2'
90+
dependencies: lowest
91+
- php: '7.4'
92+
dependencies: highest
93+
- php: '8.0'
94+
dependencies: lowest
95+
- php: '8.1'
96+
dependencies: highest
9397

9498
steps:
9599
- name: Checkout
@@ -104,27 +108,14 @@ jobs:
104108
- name: Setup Problem Matchers for PHPUnit
105109
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
106110

107-
- name: Determine Composer cache directory
108-
id: composer-cache
109-
run: echo "::set-output name=directory::$(composer config cache-dir)"
110-
111-
- name: Cache Composer dependencies
112-
uses: actions/cache@v2
113-
with:
114-
path: ${{ steps.composer-cache.outputs.directory }}
115-
key: ${{ runner.os }}-${{ matrix.php }}-composer-${{ matrix.dependencies }}-${{ hashFiles('**/composer.lock') }}
116-
restore-keys: ${{ runner.os }}-${{ matrix.php }}-composer-${{ matrix.dependencies }}-
117-
118111
- name: Remove optional packages
119112
run: composer remove doctrine/dbal doctrine/doctrine-bundle symfony/messenger symfony/twig-bundle symfony/cache --dev --no-update
120113

121-
- name: Install highest dependencies
122-
run: composer update --no-progress --no-interaction --prefer-dist
123-
if: ${{ matrix.dependencies == 'highest' }}
124-
125-
- name: Install lowest dependencies
126-
run: composer update --no-progress --no-interaction --prefer-dist --prefer-lowest
127-
if: ${{ matrix.dependencies == 'lowest' }}
114+
- name: Install dependencies
115+
uses: ramsey/composer-install@v1
116+
with:
117+
dependency-versions: ${{ matrix.dependencies }}
118+
composer-options: --prefer-dist
128119

129120
- name: Run tests
130121
run: vendor/bin/phpunit --coverage-clover=build/coverage-report.xml

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
"phpstan/extension-installer": "^1.0",
4545
"phpstan/phpstan": "^0.12",
4646
"phpstan/phpstan-phpunit": "^0.12",
47-
"phpunit/phpunit": "^8.5||^9.0",
47+
"phpunit/phpunit": "^8.5.14||^9.0",
4848
"symfony/browser-kit": "^3.4.44||^4.4.20||^5.0.11",
4949
"symfony/cache": "^3.4.44||^4.4.20||^5.0.11",
5050
"symfony/dom-crawler": "^3.4.44||^4.4.20||^5.0.11",

0 commit comments

Comments
 (0)