Skip to content

Commit

Permalink
Add full PHP 8.4 support
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian Kolb committed Feb 2, 2025
1 parent 4ade7c9 commit 5177a70
Show file tree
Hide file tree
Showing 6 changed files with 907 additions and 123 deletions.
3 changes: 3 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
XDEBUG_MODE=coverage

# PHP-CS-Fixer is not officially compatible with PHP 8.4 yet.
PHP_CS_FIXER_IGNORE_ENV=1
3 changes: 3 additions & 0 deletions .github/workflows/.env
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
XDEBUG_MODE=coverage

# PHP-CS-Fixer is not officially compatible with PHP 8.4 yet.
PHP_CS_FIXER_IGNORE_ENV=1
18 changes: 9 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,18 +98,18 @@ jobs:
- name: Setup env
run: cp .github/workflows/.env .env

- name: Restore cache for PHP 8.3 dependencies
id: cache-php-8-3-dependencies
- name: Restore cache for PHP 8.4 dependencies
id: cache-php-8-4-dependencies
uses: actions/cache/restore@v3
with:
path: |
~/.cache
vendor
key: ${{ runner.os }}-php-8-3-cache-${{ hashFiles('composer.lock') }}
key: ${{ runner.os }}-php-8-4-cache-${{ hashFiles('composer.lock') }}

- name: Install
if: steps.cache-php-8-4-dependencies.outputs.cache-hit != 'true'
run: make install-8.3
run: make install-8.4

- name: Run mutation testing
run: make php-mutation-testing-ci
Expand All @@ -130,18 +130,18 @@ jobs:
- name: Setup env
run: cp .github/workflows/.env .env

- name: Restore cache for PHP 8.3 dependencies
id: cache-php-8-3-dependencies
- name: Restore cache for PHP 8.4 dependencies
id: cache-php-8-4-dependencies
uses: actions/cache/restore@v3
with:
path: |
~/.cache
vendor
key: ${{ runner.os }}-php-8-3-cache-${{ hashFiles('composer.lock') }}
key: ${{ runner.os }}-php-8-4-cache-${{ hashFiles('composer.lock') }}

- name: Install
if: steps.cache-php-8-3-dependencies.outputs.cache-hit != 'true'
run: make install-8.3
if: steps.cache-php-8-4-dependencies.outputs.cache-hit != 'true'
run: make install-8.4

- name: Run code validation
run: make php-code-validation
18 changes: 9 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ reset: .reset
.reset: .down .install .up

.PHONY: .install
install: install-8.3
install: install-8.4

.PHONY: install-8.3
install-8.3:
Expand All @@ -53,7 +53,7 @@ install-8.4:
docker compose run --rm php-8.4 composer install

.PHONY: .php-cli
php-cli: php-8.3-cli
php-cli: php-8.4-cli

.PHONY: php-8.3-cli
php-8.3-cli:
Expand Down Expand Up @@ -83,7 +83,7 @@ php-8.4-tests:
docker compose run --rm php-8.4 ./vendor/bin/phpunit

.PHONY: php-tests-coverage
php-tests-coverage: php-8.3-tests-html-coverage
php-tests-coverage: php-8.4-tests-html-coverage

.PHONY: php-8.3-tests-html-coverage
php-8.3-tests-html-coverage:
Expand All @@ -95,12 +95,12 @@ php-8.4-tests-html-coverage:

.PHONY: php-code-validation
php-code-validation:
docker compose run --rm php-8.3 ./vendor/bin/php-cs-fixer fix
docker compose run --rm php-8.3 ./vendor/bin/psalm --show-info=false --no-diff
docker compose run --rm php-8.4 ./vendor/bin/php-cs-fixer fix
docker compose run --rm php-8.4 ./vendor/bin/psalm --show-info=false --no-diff

.PHONY: php-mutation-testing
php-mutation-testing:
docker compose run --rm php-8.3 ./vendor/bin/infection --show-mutations --only-covered --threads=8
docker compose run --rm php-8.4 ./vendor/bin/infection --show-mutations --only-covered --threads=8

##
## CI
Expand All @@ -109,12 +109,12 @@ php-mutation-testing:

.PHONY: php-8.3-tests-ci
php-8.3-tests-ci:
docker compose run --rm php-8.3 ./vendor/bin/phpunit --coverage-clover ./coverage.xml
docker compose run --rm php-8.3 ./vendor/bin/phpunit

.PHONY: php-8.4-tests-ci
php-8.4-tests-ci:
docker compose run --rm php-8.4 ./vendor/bin/phpunit
docker compose run --rm php-8.4 ./vendor/bin/phpunit --coverage-clover ./coverage.xml

.PHONY: php-mutation-testing-ci
php-mutation-testing-ci:
docker compose run --rm php-8.3 ./vendor/bin/infection --only-covered --threads=max
docker compose run --rm php-8.4 ./vendor/bin/infection --only-covered --threads=max
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"type": "symfony-bundle",
"require": {
"php": "8.3.*|8.4.*",
"digital-craftsman/self-aware-normalizers": "^0.2.0",
"digital-craftsman/self-aware-normalizers": "^0.3.0",
"doctrine/dbal": "^3.4.0",
"symfony/framework-bundle": "^7.0",
"symfony/serializer": "^7.0"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.40",
"friendsofphp/php-cs-fixer": "^3.68.5",
"infection/infection": "0.29.*",
"phpunit/phpunit": "^10.5",
"vimeo/psalm": "^6.0.0"
Expand Down
Loading

0 comments on commit 5177a70

Please sign in to comment.