Skip to content

Commit 1d6d4a2

Browse files
authored
chore: prepare Symfony 8 compatibility (#23)
1 parent e12b7bf commit 1d6d4a2

4 files changed

Lines changed: 139 additions & 72 deletions

File tree

.github/workflows/ci.yml

Lines changed: 0 additions & 71 deletions
This file was deleted.

.github/workflows/lint.yaml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: Lint
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
8+
jobs:
9+
lint:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v6
13+
14+
- name: 'Setup PHP'
15+
uses: shivammathur/setup-php@v2
16+
with:
17+
php-version: 8.3
18+
19+
- uses: ramsey/composer-install@v4
20+
21+
- name: PHP CS Fixer
22+
run: ./vendor/bin/php-cs-fixer check
23+
24+
rector:
25+
runs-on: ubuntu-latest
26+
steps:
27+
- uses: actions/checkout@v6
28+
29+
- name: 'Setup PHP'
30+
uses: shivammathur/setup-php@v2
31+
with:
32+
php-version: 8.3
33+
34+
- uses: ramsey/composer-install@v4
35+
with:
36+
working-directory: "tools/rector"
37+
38+
- name: Rector
39+
run: ./tools/bin/rector --dry-run
40+
41+
others:
42+
name: Others Quality Checks
43+
runs-on: ubuntu-latest
44+
45+
steps:
46+
- name: Checkout code
47+
uses: actions/checkout@v6
48+
49+
- name: Setup PHP
50+
uses: shivammathur/setup-php@v2
51+
with:
52+
php-version: 8.3
53+
54+
- name: Download dependencies
55+
uses: ramsey/composer-install@v4
56+
57+
- name: Lint Composer config
58+
shell: bash
59+
run: composer validate
60+
61+
- name: Check that PSR is respected
62+
shell: bash
63+
run: composer dump-autoload --dev -o --dry-run --strict-psr
64+
65+
- name: Check whether a PHP dependency is compromised
66+
shell: bash
67+
run: composer audit

.github/workflows/tests.yaml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
8+
jobs:
9+
test:
10+
name: "Tests (PHP ${{ matrix.php }})"
11+
runs-on: ubuntu-latest
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
include:
16+
- php: 8.3
17+
symfony-version: 7.2.*
18+
composer-flags: '--prefer-stable --ignore-platform-req=php+'
19+
stability: stable
20+
- php: 8.3
21+
symfony-version: 7.3.*
22+
composer-flags: '--prefer-stable'
23+
- php: 8.3
24+
symfony-version: 7.4.*
25+
composer-flags: '--prefer-stable'
26+
- php: 8.4
27+
symfony-version: 7.2.*
28+
composer-flags: '--prefer-stable'
29+
- php: 8.4
30+
symfony-version: 7.3.*
31+
composer-flags: '--prefer-stable'
32+
- php: 8.4
33+
symfony-version: 7.4.*
34+
composer-flags: '--prefer-stable'
35+
- php: 8.4
36+
symfony-version: 8.0.*
37+
composer-flags: '--prefer-stable'
38+
- php: 8.5
39+
symfony-version: 7.3.*
40+
composer-flags: '--prefer-stable'
41+
- php: 8.5
42+
symfony-version: 7.4.*
43+
composer-flags: '--prefer-stable'
44+
- php: 8.5
45+
symfony-version: 8.0.*
46+
composer-flags: '--prefer-stable'
47+
steps:
48+
- name: "Checkout"
49+
uses: actions/checkout@v6
50+
51+
- name: "Install PHP with extensions"
52+
uses: shivammathur/setup-php@v2
53+
with:
54+
php-version: ${{ matrix.php }}
55+
56+
- name: Install dependencies
57+
env:
58+
SYMFONY_REQUIRE: ${{ matrix.symfony-version }}
59+
run: composer update ${{ matrix.composer-flags }} --no-interaction --no-progress --optimize-autoloader
60+
61+
- name: Install PDFtk
62+
run: sudo apt install -y pdftk
63+
64+
- name: Run tests and collect coverage
65+
run: vendor/bin/phpunit --coverage-clover coverage.xml
66+
67+
- name: Upload coverage to Codecov
68+
uses: codecov/codecov-action@v6
69+
env:
70+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
],
2222
"require": {
2323
"php": "^8.3",
24-
"symfony/process": "^7.2"
24+
"symfony/process": "^7.2 || ^8.0"
2525
},
2626
"require-dev": {
2727
"phpunit/phpunit": "^12",
@@ -31,6 +31,7 @@
3131
"phpstan/phpstan-phpunit": "^2.0"
3232
},
3333
"config": {
34+
"sort-packages": true,
3435
"allow-plugins": {
3536
"phpstan/extension-installer": true
3637
}

0 commit comments

Comments
 (0)