Skip to content

Commit 3a64204

Browse files
authored
Merge pull request #102 from Exercise/sf-7
Allow Symfony 7
2 parents 526c98e + 70e4021 commit 3a64204

File tree

5 files changed

+53
-79
lines changed

5 files changed

+53
-79
lines changed

.github/workflows/qa.yaml

Lines changed: 36 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -5,59 +5,14 @@ on:
55
pull_request:
66

77
jobs:
8-
build:
9-
name: Build
10-
runs-on: ubuntu-latest
11-
strategy:
12-
fail-fast: true
13-
matrix:
14-
php-versions: ['7.1', '8.1']
15-
16-
steps:
17-
- name: Checkout
18-
uses: actions/checkout@v2
19-
20-
- name: Setup PHP, extensions and composer with shivammathur/setup-php
21-
uses: shivammathur/setup-php@v2
22-
with:
23-
php-version: ${{ matrix.php-versions }}
24-
extensions: mbstring, xml, ctype, iconv, intl, pdo, pdo_mysql, dom, filter, gd, iconv, json, mbstring, pdo
25-
env:
26-
update: true
27-
28-
- name: Validate composer.json
29-
run: composer validate --strict
30-
31-
- name: Get composer cache directory
32-
id: composer-cache
33-
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
34-
35-
- name: Install Composer dependencies
36-
run: composer install --no-progress --prefer-dist --optimize-autoloader
37-
38-
- name: Install Lowest Composer dependencies
39-
if: "matrix.php-versions < '8.1'"
40-
run: composer update --prefer-lowest --no-progress --prefer-dist --optimize-autoloader
41-
42-
- name: Install PHPUnit
43-
run: vendor/bin/simple-phpunit install
44-
45-
- name: Cache composer dependencies
46-
uses: actions/cache@v1
47-
with:
48-
path: ${{ steps.composer-cache.outputs.dir }}
49-
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
50-
restore-keys: ${{ runner.os }}-composer-
51-
php-version: ${{ matrix.php-versions }}
52-
538
qa:
549
name: Quality
55-
needs: build
5610
runs-on: ubuntu-latest
5711
strategy:
5812
fail-fast: true
5913
matrix:
60-
php-versions: ['8.1']
14+
php-versions:
15+
- 8.2
6116

6217
steps:
6318
- name: Checkout
@@ -68,28 +23,38 @@ jobs:
6823
with:
6924
php-version: ${{ matrix.php-versions }}
7025
extensions: mbstring, xml, ctype, intl, dom, filter
71-
tools: symfony
7226
env:
7327
update: true
7428

75-
- name: Get composer cache directory
76-
id: composer-cache
77-
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
78-
7929
- name: Install Composer dependencies
80-
run: composer install --no-progress --prefer-dist --optimize-autoloader
30+
run: composer install --working-dir=qa/php-cs-fixer
8131

8232
- name: PHP-CS-Fixer
83-
run: symfony php ./vendor/bin/php-cs-fixer fix --dry-run --using-cache=no --verbose --diff
33+
run: ./qa/php-cs-fixer/vendor/bin/php-cs-fixer fix --dry-run --using-cache=no --verbose --diff
8434

8535
test:
8636
name: Tests
87-
needs: build
8837
runs-on: ubuntu-latest
8938
strategy:
9039
fail-fast: true
9140
matrix:
92-
php-versions: ['7.1', '8.1']
41+
php-versions:
42+
- 8.1
43+
- 8.2
44+
symfony-versions:
45+
- 5.4.*
46+
- 6.3.*
47+
- 6.4.*
48+
- 7.0.*
49+
dependencies:
50+
- ''
51+
include:
52+
- php-versions: '8.1'
53+
symfony-versions: '5.4.*'
54+
dependencies: 'lowest'
55+
exclude:
56+
- php-versions: '8.1'
57+
symfony-versions: '7.0.*'
9358

9459
steps:
9560
- name: Checkout
@@ -99,21 +64,25 @@ jobs:
9964
uses: shivammathur/setup-php@v2
10065
with:
10166
php-version: ${{ matrix.php-versions }}
102-
extensions: mbstring, xml, ctype, intl, dom, filter
103-
tools: symfony
67+
extensions: mbstring, xml, ctype, iconv, intl, pdo, pdo_mysql, dom, filter, gd, json
68+
tools: flex
10469
env:
10570
update: true
10671

107-
- name: Get composer cache directory
108-
id: composer-cache
109-
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
110-
111-
- name: Install Composer dependencies
112-
run: composer install --no-progress --prefer-dist --optimize-autoloader
72+
- name: Install Composer
73+
if: "matrix.dependencies == ''"
74+
run: composer update --no-progress --ansi --prefer-stable
75+
env:
76+
SYMFONY_REQUIRE: ${{ matrix.symfony-versions }}
11377

11478
- name: Install Lowest Composer dependencies
115-
if: "matrix.php-versions < '8.1'"
116-
run: composer install --no-progress --prefer-dist --optimize-autoloader
79+
if: "matrix.dependencies == 'lowest'"
80+
run: composer update --no-progress --ansi --prefer-stable --prefer-lowest
81+
env:
82+
SYMFONY_REQUIRE: ${{ matrix.symfony-versions }}
83+
84+
- name: Validate composer
85+
run: composer validate --strict --no-check-lock
11786

11887
- name: Execute unit tests
119-
run: symfony php ./vendor/bin/simple-phpunit
88+
run: ./vendor/bin/simple-phpunit

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,5 +324,5 @@ previous, and "all" could define its own rules too.
324324

325325
## Contributing
326326

327-
PRs are welcomed :). Please target the `3.x` branch for bug fixes and `master`
327+
PRs are welcomed :). Please target the `4.x` branch for bug fixes and `master`
328328
for new features.

composer.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,16 @@
1212
}
1313
],
1414
"require": {
15-
"php": "^7.1.3 || ^8.0.0",
15+
"php": "^8.1",
1616
"ezyang/htmlpurifier": "~4.14",
17-
"symfony/config": "~4.4 || ^5.0 || ^6.0",
18-
"symfony/dependency-injection": "^4.4 || ^5.0 || ^6.0",
19-
"symfony/http-kernel": "^4.4 || ^5.0 || ^6.0"
17+
"symfony/config": "^5.4 || ^6.0 || ^7.0",
18+
"symfony/dependency-injection": "^5.4 || ^6.0 || ^7.0",
19+
"symfony/http-kernel": "^5.4 || ^6.0 || ^7.0"
2020
},
2121
"require-dev": {
22-
"friendsofphp/php-cs-fixer": "^3.0",
23-
"symfony/form": "^4.4 || ^5.0 || ^6.0",
24-
"symfony/phpunit-bridge": "^6.0",
25-
"twig/twig": "^1.35.0 || ^2.4.4 || ^3.0"
22+
"symfony/form": "^5.4 || ^6.0 || ^7.0",
23+
"symfony/phpunit-bridge": "^7.0",
24+
"twig/twig": "^2.4.4 || ^3.0"
2625
},
2726
"autoload": {
2827
"psr-4": { "Exercise\\HTMLPurifierBundle\\": "src/" }
@@ -35,7 +34,8 @@
3534
},
3635
"extra": {
3736
"branch-alias": {
38-
"dev-master": "4.x-dev"
37+
"dev-master": "5.x-dev"
3938
}
40-
}
39+
},
40+
"minimum-stability": "dev"
4141
}

qa/php-cs-fixer/composer.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"require": {
3+
"friendsofphp/php-cs-fixer": "^3.38"
4+
}
5+
}

src/CacheWarmer/SerializerCacheWarmer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function __construct(array $paths, array $profiles, HTMLPurifiersRegistry
3737
$this->filesystem = $filesystem;
3838
}
3939

40-
public function warmUp($cacheDir): array
40+
public function warmUp($cacheDir, string $buildDir = null): array
4141
{
4242
foreach ($this->paths as $path) {
4343
$this->filesystem->remove($path); // clean previous cache

0 commit comments

Comments
 (0)