Skip to content

Upgrade dev deps and bump php min to 8.1 #138

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
php: [7.4, 8.0, 8.1]
php: [8.1, 8.2, 8.3, 8.4]
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down
6 changes: 1 addition & 5 deletions .github/workflows/static-analysis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ jobs:
script: make cs-check
- description: PHPStan
script: make phpstan
- description: PSalm
script: make psalm
- description: Type assertions
script: make type-assertions

name: ${{ matrix.description }}
runs-on: ubuntu-latest
Expand All @@ -30,7 +26,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
php-version: 8.1
- name: Install dependencies
uses: ramsey/composer-install@v2
- run: ${{ matrix.script }}
36 changes: 11 additions & 25 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,32 +9,22 @@ help:
| xargs -I _ sh -c 'printf "%-40s " _; make _ -nB | (grep -i "^# Help:" || echo "") | tail -1 | sed "s/^# Help: //g"'


.PHONY: run run-php7.4 run-php8.0 run-php8.1 run-php8.2
run-php7.4:
@# Help: It creates and runs a docker image with PHP 7.4
docker-compose run --rm php74 bash -c "rm composer.lock || true; composer install --no-interaction; bash"
run-php8.0:
@# Help: It creates and runs a docker image with PHP 8.0
docker-compose run --rm php80 bash -c "rm composer.lock || true; composer install --no-interaction; bash"
.PHONY: run run-php8.1 run-php8.2 run-php8.3 run-php8.4
run-php8.1:
@# Help: It creates and runs a docker image with PHP 8.1
docker-compose run --rm php81 bash -c "rm composer.lock || true; composer install --no-interaction; bash"
run-php8.2:
@# Help: It creates and runs a docker image with PHP 8.2
docker-compose run --rm php82 bash -c "rm composer.lock || true; composer install --no-interaction; bash"
run: run-php7.4
run-php8.3:
@# Help: It creates and runs a docker image with PHP 8.3
docker-compose run --rm php83 bash -c "rm composer.lock || true; composer install --no-interaction; bash"
run-php8.4:
@# Help: It creates and runs a docker image with PHP 8.4
docker-compose run --rm php84 bash -c "rm composer.lock || true; composer install --no-interaction; bash"
run: run-php8.1
@# Help: It creates and runs a docker image with the lowest supported PHP version

.PHONY: psalm psalm-update-baseline
psalm:
@# Help: It runs Psalm
./vendor/bin/psalm --no-cache

psalm-update-baseline:
@# Help: It updates the Psalm baseline
./vendor/bin/psalm --update-baseline


.PHONY: phpstan phpstan-update-baseline
phpstan:
@# Help: It runs PHPStan
Expand All @@ -45,11 +35,7 @@ phpstan-update-baseline:
./vendor/bin/phpstan analyse src tests --generate-baseline


.PHONY: type-assertions test
type-assertions:
@# Help: It runs tests on Psalm types
./vendor/bin/psalm tests/type-assertions --no-cache

.PHONY: test
test:
@# Help: It runs PHPUnit tests
XDEBUG_MODE=coverage ./vendor/bin/phpunit
Expand All @@ -63,10 +49,10 @@ cs-check:
@# Help: It runs the code style check
./vendor/bin/php-cs-fixer fix --ansi --verbose --dry-run

ci: test phpstan psalm type-assertions cs-fix
ci: test phpstan cs-fix
@# Help: It runs all tests and code style fix

ci-check: test phpstan psalm type-assertions cs-check
ci-check: test phpstan cs-check
@# Help: It runs all tests and code style check

.PHONY: rector
Expand Down
16 changes: 7 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@
"description": "A partial porting of io-ts in PHP",
"type": "library",
"require-dev": {
"phpunit/phpunit": "^9",
"giorgiosironi/eris": "^0.14.0",
"phpat/phpat": "^0.10.18",
"facile-it/facile-coding-standard": "^1.2",
"vimeo/psalm": "4.30.0",
"phpstan/phpstan": "^1.8",
"rector/rector": "^1.2"
"phpunit/phpunit": "^10",
"giorgiosironi/eris": "^1",
"phpat/phpat": "^0.11",
"facile-it/facile-coding-standard": "^1.3",
"phpstan/phpstan": "^2",
"rector/rector": "^2"
},
"license": "MIT",
"authors": [
Expand All @@ -27,12 +26,11 @@
"psr-4": {
"Tests\\Facile\\PhpCodec\\": "tests/unit/",
"Examples\\Facile\\PhpCodec\\": "tests/examples/",
"TypeAssertions\\Facile\\PhpCodec\\": "tests/type-assertions/",
"ArchitectureAssertions\\Facile\\PhpCodec\\": "tests/architecture/"
}
},
"require": {
"php": "^7.4 | ^8.0"
"php": "^8.1"
},
"prefer-stable": true,
"archive": {
Expand Down
22 changes: 11 additions & 11 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
version: "3.8"

services:
php74: &base
php81: &base
build:
context: docker/
args:
PHP_IMAGE: php:7.4
XDEBUG: xdebug-3.1.5
PHP_IMAGE: php:8.1
volumes:
- .:/home/dev/lib
tty: true
user: dev
working_dir: /home/dev/lib
php80:

php82:
<<: *base
build:
context: docker/
args:
PHP_IMAGE: php:8.0
php81:
PHP_IMAGE: php:8.2

php83:
<<: *base
build:
context: docker/
args:
PHP_IMAGE: php:8.1
php82:
PHP_IMAGE: php:8.3

php84:
<<: *base
build:
context: docker/
args:
PHP_IMAGE: php:8.2
PHP_IMAGE: php:8.4
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG PHP_IMAGE
ARG PHP_IMAGE=php:8.1
FROM $PHP_IMAGE

COPY --from=composer /usr/bin/composer /usr/bin/composer
Expand Down
Loading