Skip to content

Commit

Permalink
Merge pull request #333 from Yoast/drop-php-5.6-7.0-7.1
Browse files Browse the repository at this point in the history
Drop compatibility with PHP 5.6, 7.0 and 7.1
  • Loading branch information
enricobattocchi committed Mar 23, 2023
2 parents df78eec + 8c27eae commit 4a2c0ff
Show file tree
Hide file tree
Showing 6 changed files with 660 additions and 763 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
matrix:
# Lint against the highest/lowest supported versions of each PHP major.
# And also do a run against "nightly" (the current dev version of PHP).
php_version: ['5.6', '7.0', '7.4', '8.0', '8.1', '8.2']
php_version: ['7.2', '7.4', '8.0', '8.1', '8.2']

name: "Lint: PHP ${{ matrix.php_version }}"

Expand Down
20 changes: 9 additions & 11 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:

strategy:
matrix:
php_version: ['5.6', '7.0', '7.4', '8.0', '8.1', '8.2']
php_version: ['7.2', '7.4', '8.0', '8.1', '8.2']

name: "Unit Test: PHP ${{ matrix.php_version }}"

Expand All @@ -39,23 +39,21 @@ jobs:
ini-values: zend.assertions=1, error_reporting=-1, display_errors=On
coverage: none

# The PHP platform requirement would prevent updating the test utilities to the appropriate versions.
# As long as the `composer update` is run selectively to only update the test utils, removing this is fine.
- name: "Composer: remove the PHP platform requirement"
run: composer config --unset platform.php

# Install dependencies and handle caching in one go.
# - Updates the test utilities to the most appropriate version for the PHP version on which the tests will be run.
# @link https://github.com/marketplace/actions/install-composer-dependencies
- name: Install Composer dependencies (PHP < 7.3)
if: ${{ matrix.php_version < '7.3' }}
uses: ramsey/composer-install@v2
with:
# Bust the cache at least once a month - output format: YYYY-MM.
custom-cache-suffix: $(date -u "+%Y-%m")

- name: Install Composer dependencies (PHP 7.3+)
if: ${{ matrix.php_version >= '7.3' }}
- name: Install Composer dependencies
uses: ramsey/composer-install@v2
with:
# Force a `composer update` run.
dependency-versions: "highest"
# But make it selective.
composer-options: "yoast/wp-test-utils --with-dependencies --ignore-platform-req=php"
composer-options: "yoast/wp-test-utils --with-dependencies"
# Bust the cache at least once a month - output format: YYYY-MM.
custom-cache-suffix: $(date -u "+%Y-%m")

Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@
"minimum-stability": "dev",
"prefer-stable": true,
"require": {
"php": ">=5.6",
"php": "^7.2.5 || ^8.0",
"composer/installers": "^1.12.0"
},
"require-dev": {
"yoast/yoastcs": "^2.3.0",
"yoast/yoastcs": "^2.3.1",
"yoast/wp-test-utils": "^1.1.1"
},
"autoload": {
Expand All @@ -63,7 +63,7 @@
},
"config": {
"platform": {
"php": "5.6.40"
"php": "7.2.5"
},
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true,
Expand Down
Loading

0 comments on commit 4a2c0ff

Please sign in to comment.