Skip to content

Commit 82b76fe

Browse files
author
Cristoforo Cervino
committed
enhance composer.json and gitlab ci
1 parent 411c5a8 commit 82b76fe

File tree

2 files changed

+19
-25
lines changed

2 files changed

+19
-25
lines changed

.github/workflows/ci.yml

Lines changed: 17 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,15 @@ jobs:
1111
runs-on: ubuntu-latest
1212
strategy:
1313
matrix:
14-
include:
14+
php-version: ['8.2', '8.4', '8.5']
15+
symfony-version: ['5.4.*', '6.4.*', '7.0.*']
16+
doctrine-orm-version: ['2.20.*', '3.0.*']
17+
exclude:
18+
# Doctrine ORM 3.0 requires PHP 8.4+
1519
- php-version: '8.2'
16-
symfony-version: '6.4.*'
17-
- php-version: '8.2'
18-
symfony-version: '7.0.*'
19-
20-
name: PHP ${{ matrix.php-version }} · SF ${{ matrix.symfony-version }}
20+
doctrine-orm-version: '3.0.*'
2121

22-
services:
23-
mysql:
24-
image: mysql:8.0
25-
env:
26-
MYSQL_ROOT_PASSWORD: root
27-
MYSQL_DATABASE: test
28-
ports:
29-
- 3306:3306
30-
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
22+
name: PHP ${{ matrix.php-version }} · SF ${{ matrix.symfony-version }} · Doctrine ORM ${{ matrix.doctrine-orm-version }}
3123

3224
steps:
3325
- uses: actions/checkout@v4
@@ -36,33 +28,35 @@ jobs:
3628
uses: shivammathur/setup-php@v2
3729
with:
3830
php-version: ${{ matrix.php-version }}
39-
extensions: mbstring, xml, ctype, iconv, intl, json
40-
coverage: ${{ matrix.symfony-version == '7.0.*' && 'pcov' || 'none' }}
31+
extensions: mbstring, xml, ctype, iconv, intl, json, pdo_sqlite, sqlite3
32+
coverage: ${{ matrix.php-version == '8.5' && matrix.symfony-version == '7.0.*' && matrix.doctrine-orm-version == '3.0.*' && 'pcov' || 'none' }}
4133

4234
- name: Constrain Symfony version
4335
run: |
4436
sed -ri 's/"symfony\/([^"]+)": "[^"]+"/"symfony\/\1": "${{ matrix.symfony-version }}"/g' composer.json
4537
38+
- name: Constrain Doctrine ORM version
39+
run: |
40+
sed -ri 's/"doctrine\/orm": "[^"]+"/"doctrine\/orm": "${{ matrix.doctrine-orm-version }}"/' composer.json
41+
4642
- name: Install Composer dependencies
4743
uses: ramsey/composer-install@v3
4844
with:
4945
composer-options: "--prefer-dist --no-progress --no-interaction --optimize-autoloader"
5046

5147
- name: Run PHP-CS-Fixer
52-
if: matrix.symfony-version == '7.0.*'
48+
if: matrix.php-version == '8.2' && matrix.symfony-version == '5.4.*' && matrix.doctrine-orm-version == '2.20.*'
5349
run: vendor/bin/php-cs-fixer fix --dry-run --stop-on-violation --using-cache=no
5450

5551
- name: Run PHPStan
56-
if: matrix.symfony-version == '7.0.*'
52+
if: matrix.php-version == '8.5' && matrix.symfony-version == '7.0.*' && matrix.doctrine-orm-version == '3.0.*'
5753
run: vendor/bin/phpstan analyse src tests --configuration=phpstan.neon --memory-limit=1G
5854

5955
- name: Run PHPUnit tests
60-
env:
61-
DATABASE_URL: mysql://root:root@127.0.0.1:3306/test?serverVersion=8.0
62-
run: vendor/bin/phpunit ${{ matrix.symfony-version == '7.0.*' && '--coverage-clover coverage.xml' || '' }}
56+
run: vendor/bin/phpunit ${{ matrix.php-version == '8.5' && matrix.symfony-version == '7.0.*' && matrix.doctrine-orm-version == '3.0.*' && '--coverage-clover coverage.xml' || '' }}
6357

6458
- name: Upload coverage to Codecov
65-
if: matrix.symfony-version == '7.0.*'
59+
if: matrix.php-version == '8.5' && matrix.symfony-version == '7.0.*' && matrix.doctrine-orm-version == '3.0.*'
6660
uses: codecov/codecov-action@v4
6761
with:
6862
files: ./coverage.xml

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,15 @@
3030
"php": "^8.2",
3131
"symfony/framework-bundle": "^5.0 | ^6.0 | ^7.0",
3232
"doctrine/common": "^2.13 || ^3.0",
33+
"doctrine/doctrine-bundle": "^2.10 || ^3.0",
3334
"doctrine/event-manager": "^1.2 | ^2.0",
35+
"doctrine/orm": "^2.15.3 || ^3.0",
3436
"symfony/clock": "^6.2 | ^7.0"
3537
},
3638
"require-dev": {
3739
"ext-json": "*",
3840
"roave/security-advisories": "dev-master",
39-
"doctrine/orm": "^2.15.3",
4041
"phpunit/phpunit": "^9.5",
41-
"doctrine/doctrine-bundle": "^2.10",
4242
"phpstan/phpstan": "^1.2",
4343
"phpstan/phpstan-phpunit": "^1.0",
4444
"phpstan/extension-installer": "^1.1",

0 commit comments

Comments
 (0)