Skip to content

Commit

Permalink
Drop support for PHP 8.2 (#80)
Browse files Browse the repository at this point in the history
  • Loading branch information
Slamdunk authored Feb 11, 2025
1 parent 66248ec commit a0e5ae0
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 127 deletions.
148 changes: 31 additions & 117 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,202 +7,116 @@ on:
- "master"
- "renovate/*"

env:
INI_VALUES: zend.assertions=1,error_reporting=-1,date.timezone="Europe/Rome"

jobs:
composer-json-lint:
name: "Lint composer.json"

runs-on: "ubuntu-latest"

strategy:
matrix:
php-version:
- "8.2"
- "8.3"

steps:
- name: "Checkout"
uses: "actions/checkout@v4"

- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
- uses: "actions/checkout@v4"
- uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
php-version: "${{ matrix.php-version }}"
ini-values: "${{ env.INI_VALUES }}"
tools: composer-normalize

- name: "Validate composer.json"
run: "composer validate --strict"

- name: "Normalize composer.json"
run: "composer-normalize --dry-run"
- run: "composer validate --strict"
- run: "composer-normalize --dry-run"

tests:
name: "Tests"

runs-on: "ubuntu-latest"

strategy:
matrix:
php-version:
- "8.2"
- "8.3"
- "8.4"
dependencies:
- "highest"

steps:
- name: "Checkout"
uses: "actions/checkout@v4"

- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
- uses: "actions/checkout@v4"
- uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
coverage: "pcov"
php-version: "${{ matrix.php-version }}"
ini-values: zend.assertions=1

- name: "Get composer cache directory"
id: composercache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: "Cache dependencies"
uses: actions/cache@v4
with:
path: ${{ steps.composercache.outputs.dir }}
key: ${{ runner.os }}-php-${{ matrix.php-version }}-${{ matrix.dependencies }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-php-${{ matrix.php-version }}-${{ matrix.dependencies }}-composer-

- name: "Remove PHP-CS-Fixer not ready for PHP 8.3 yet"
run: "composer remove --dev --no-update slam/php-cs-fixer-extensions"

- name: "Install lowest dependencies"
if: ${{ matrix.dependencies == 'lowest' }}
run: "composer update --no-interaction --no-progress --prefer-lowest"

- name: "Install highest dependencies"
if: ${{ matrix.dependencies == 'highest' }}
run: "composer update --no-interaction --no-progress"
ini-values: "${{ env.INI_VALUES }}"
- uses: "ramsey/composer-install@v3"

- name: "Run tests"
timeout-minutes: 5
run: "vendor/bin/phpunit --no-coverage --no-logging"

code-coverage:
name: "Code Coverage"

runs-on: "ubuntu-latest"

strategy:
matrix:
php-version:
- "8.2"
- "8.3"

steps:
- name: "Checkout"
uses: "actions/checkout@v4"

- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
- uses: "actions/checkout@v4"
- uses: "shivammathur/setup-php@v2"
with:
coverage: "pcov"
php-version: "${{ matrix.php-version }}"
ini-values: zend.assertions=1

- name: "Get composer cache directory"
id: composercache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: "Cache dependencies"
uses: actions/cache@v4
with:
path: ${{ steps.composercache.outputs.dir }}
key: ${{ runner.os }}-php-${{ matrix.php-version }}-${{ matrix.dependencies }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-php-${{ matrix.php-version }}-${{ matrix.dependencies }}-composer-

- name: "Install dependencies"
run: "composer update --no-interaction --no-progress"
ini-values: "${{ env.INI_VALUES }}"
- uses: "ramsey/composer-install@v3"

- name: "Run tests"
timeout-minutes: 10
run: "vendor/bin/phpunit --coverage-clover=coverage.xml"

- name: "Send code coverage report to Codecov.io"
uses: codecov/codecov-action@v5
uses: "codecov/codecov-action@v5"
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
fail_ci_if_error: true

coding-standards:
name: "Coding Standards"

runs-on: "ubuntu-latest"

strategy:
matrix:
php-version:
- "8.2"
- "8.3"

steps:
- name: "Checkout"
uses: "actions/checkout@v4"

- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
- uses: "actions/checkout@v4"
- uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
php-version: "${{ matrix.php-version }}"

- name: "Get composer cache directory"
id: composercache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: "Cache dependencies"
uses: actions/cache@v4
with:
path: ${{ steps.composercache.outputs.dir }}
key: ${{ runner.os }}-php-${{ matrix.php-version }}-${{ matrix.dependencies }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-php-${{ matrix.php-version }}-${{ matrix.dependencies }}-composer-

- name: "Install dependencies"
run: "composer update --no-interaction --no-progress"
ini-values: "${{ env.INI_VALUES }}"
- uses: "ramsey/composer-install@v3"

- name: "Check coding standards"
run: "vendor/bin/php-cs-fixer fix --verbose --dry-run --diff"

static-analysis:
name: "Static Analysis"

runs-on: "ubuntu-latest"

strategy:
matrix:
php-version:
- "8.2"
- "8.3"

steps:
- name: "Checkout"
uses: "actions/checkout@v4"

- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
- uses: "actions/checkout@v4"
- uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
php-version: "${{ matrix.php-version }}"
tools: cs2pr

- name: "Get composer cache directory"
id: composercache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: "Cache dependencies"
uses: actions/cache@v4
with:
path: ${{ steps.composercache.outputs.dir }}
key: ${{ runner.os }}-php-${{ matrix.php-version }}-${{ matrix.dependencies }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-php-${{ matrix.php-version }}-${{ matrix.dependencies }}-composer-

- name: "Install dependencies"
run: "composer update --no-interaction --no-progress"
ini-values: "${{ env.INI_VALUES }}"
- uses: "ramsey/composer-install@v3"

- name: "Run static analysis"
run: "vendor/bin/phpstan analyse --no-progress --error-format=checkstyle | cs2pr"
run: "vendor/bin/phpstan analyse --no-progress"
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM php:8.4
FROM php:8.3

ADD --chmod=0755 https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
DOCKER_PHP_EXEC := docker compose run --rm php
DOCKER_PHP_EXEC := docker compose run --rm --env PHP_CS_FIXER_IGNORE_ENV=1 php
PHP_BIN=php -d zend.assertions=1

all: csfix static-analysis test
Expand Down
16 changes: 8 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,22 @@
}
],
"require": {
"php": "~8.2.0 || ~8.3.0 || ~8.4.0",
"phpstan/phpstan": "^2.0.2"
"php": "~8.3.0 || ~8.4.0",
"phpstan/phpstan": "^2.1.4"
},
"require-dev": {
"laminas/laminas-filter": "^2.39.0",
"laminas/laminas-filter": "^2.40.0",
"laminas/laminas-form": "^3.21.0",
"laminas/laminas-hydrator": "^4.16.0",
"laminas/laminas-i18n": "^2.29.0",
"laminas/laminas-inputfilter": "^2.31.0",
"laminas/laminas-mvc": "^3.8.0",
"laminas/laminas-paginator": "^2.19.0",
"laminas/laminas-validator": "^2.64.1",
"phpstan/phpstan-deprecation-rules": "^2",
"phpstan/phpstan-phpunit": "^2.0.1",
"phpunit/phpunit": "^11.4.3",
"slam/php-cs-fixer-extensions": "^3.11.1"
"laminas/laminas-validator": "^2.64.2",
"phpstan/phpstan-deprecation-rules": "^2.0.1",
"phpstan/phpstan-phpunit": "^2.0.4",
"phpunit/phpunit": "^11.5.7",
"slam/php-cs-fixer-extensions": "^3.12.0"
},
"conflict": {
"laminas/laminas-filter": "<2.37",
Expand Down

0 comments on commit a0e5ae0

Please sign in to comment.