Skip to content
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

[CMS-459] Add php 8.1 support #2295

Merged
merged 35 commits into from
Jan 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
2a02d8e
Add "schedule" event and "long" functional test suit CI workflow
Dec 17, 2021
3ca8c05
Add php 8.1 to CI functional testing matrix
Dec 17, 2021
375d35e
Add "--stop-on-failure" option to "test:short" composer script
Dec 17, 2021
04e13b5
Fix php 8.1 deprecation "Calling a static element on a trait is depre…
Dec 17, 2021
c75758d
Fix php 8.1 deprecation "Deprecated: Return type of XXX should either…
Dec 17, 2021
e9f1362
Fix php 8.1 deprecation "Passing null to non-nullable parameters of b…
Dec 17, 2021
e9194c8
Fix use of CommandExecutorTrait in LocalMachineHelper
Dec 17, 2021
914a2e8
Add php 8.1 support
Dec 17, 2021
94b821f
Add "workflow_dispatch" event to CI workflow (trigger all functional …
Dec 17, 2021
d7306ae
Update comment on error_reporting() set
Dec 17, 2021
63c9a17
Revert fix php 8.1 deprecation "Deprecated: Return type of XXX should…
Dec 19, 2021
abfcf04
Refactor TerminusTestTrait into TerminusTestBase
Dec 20, 2021
302aae1
Add "schedule" event and "long" functional test suit CI workflow
Dec 17, 2021
dbf5ef4
Add php 8.1 to CI functional testing matrix
Dec 17, 2021
98d7327
Add "--stop-on-failure" option to "test:short" composer script
Dec 17, 2021
01f2a12
Fix php 8.1 deprecation "Calling a static element on a trait is depre…
Dec 17, 2021
380d9e3
Fix php 8.1 deprecation "Deprecated: Return type of XXX should either…
Dec 17, 2021
05d6463
Fix php 8.1 deprecation "Passing null to non-nullable parameters of b…
Dec 17, 2021
3742551
Fix use of CommandExecutorTrait in LocalMachineHelper
Dec 17, 2021
fad1511
Add php 8.1 support
Dec 17, 2021
2b70216
Add "workflow_dispatch" event to CI workflow (trigger all functional …
Dec 17, 2021
9eec8d7
Update comment on error_reporting() set
Dec 17, 2021
7f2500e
Revert fix php 8.1 deprecation "Deprecated: Return type of XXX should…
Dec 19, 2021
584d632
Refactor TerminusTestTrait into TerminusTestBase
Dec 20, 2021
13b1b50
Update dependencies
greg-1-anderson Jan 5, 2022
cad15c4
Incompatible PHP version is now 8.2+
greg-1-anderson Jan 5, 2022
c887507
Move TerminusUtilsTrait methods into TerminusTestBase
Jan 10, 2022
f3f496d
Prevent outputting PHP deprecation messages produced by vendors for p…
Jan 10, 2022
44ba68c
Remove error_reporting() from Request::request()
Jan 10, 2022
0d032db
Remove php 8.0 and add php 8.2 to CI functional testing matrix
Jan 10, 2022
6d55a58
Set nightly CI to run on 6:00 UTC (closer to midnight time for EST/PDT)
Jan 10, 2022
4996a65
Set PHP error_reporting level regardless of PHP version
Jan 10, 2022
ac0a151
Suppress PHP deprecation messages in RoboFile
Jan 10, 2022
e32e935
Revert all error_reporting()
Jan 11, 2022
6d54686
Remove php 8.2 from functional testing matrix
Jan 11, 2022
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
17 changes: 15 additions & 2 deletions .github/workflows/3x.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
name: Terminus 3.x
on: push
on:
push:
schedule:
- cron: '0 6 * * *'
workflow_dispatch:
inputs:
functional_tests_all:
description: Run all functional tests
required: true
default: '1'
jobs:
# Checkout in separate job because docker image is alpine based and checkout action doesn't work.
checkout_build:
Expand Down Expand Up @@ -37,7 +46,7 @@ jobs:
strategy:
matrix:
operating-system: [ 'macos-latest' ]
php-versions: [ '7.4', '8.0' ]
php-versions: [ '7.4', '8.1' ]
max-parallel: 1
env:
TERMINUS_TOKEN: ${{ secrets.TERMINUS_TOKEN }}
Expand Down Expand Up @@ -66,7 +75,11 @@ jobs:
- name: Install Composer Dependencies
run: composer install --no-interaction --prefer-dist
- name: Functional Tests (short)
if: ${{ github.event_name == 'push' }}
run: composer test:short
- name: Functional Tests (long)
if: ${{ github.event_name == 'schedule' || github.event.inputs.functional_tests_all == '1' }}
run: composer test:long
- name: Coverage Report
run: composer coverage
- name: Save coverage as artifact
Expand Down
17 changes: 8 additions & 9 deletions bin/terminus
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env php
#!/usr/bin/env php
<?php

/**
Expand All @@ -12,22 +12,21 @@
// Unset memory limit
ini_set('memory_limit', -1);

// Version compatibility check and messaging
if (version_compare(PHP_VERSION, '7.4.0', '<') === true) {
echo "\n";
echo 'Sorry, your PHP version (' . PHP_VERSION . ') is no longer supported.' . "\n";
echo 'Upgrade to PHP 7.4 or newer to use Terminus 3. For PHP versions prior to 7.4, downgrade to Terminus 2.x.'; echo "\n\n";
exit(1);
} elseif (version_compare(PHP_VERSION, '8.1.0', '>=') === true) {
}

if (!getenv('TERMINUS_ALLOW_UNSUPPORTED_NEWER_PHP') && version_compare(PHP_VERSION, '8.2.0', '>=') === true) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The check for getenv('TERMINUS_ALLOW_UNSUPPORTED_NEWER_PHP') needs to be at the top since any echo would bloat commands' responses.

echo "\n";
echo 'PHP 8.1+ is not supported by this version of Terminus.' . "\n";
echo 'PHP 8.2+ is not supported by this version of Terminus.' . "\n";
echo 'Check for new versions at https://github.com/pantheon-systems/terminus/releases' . "\n";
echo "\n";
if (!getenv('TERMINUS_ALLOW_UNSUPPORTED_NEWER_PHP')) {
echo 'Set environment variable TERMINUS_ALLOW_UNSUPPORTED_NEWER_PHP to try continuing anyway.' . "\n";
echo "Stopping.\n\n";
exit(1);
}
echo 'Set environment variable TERMINUS_ALLOW_UNSUPPORTED_NEWER_PHP to try continuing anyway.' . "\n";
echo "Stopping.\n\n";
exit(1);
}

// This variable is automatically managed via updateDependenciesversion() in /RoboFile.php,
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,10 @@
"\\Terminus\\UpdateClassLists::update"
],
"code:fix": [
"vendor/bin/phpcbf --standard=phpcs_ruleset.xml src tests/Functional tests/unit_tests tests/Traits"
"vendor/bin/phpcbf --standard=phpcs_ruleset.xml src tests/Functional tests/unit_tests"
],
"cs": [
"vendor/bin/phpcs --standard=phpcs_ruleset.xml src tests/Functional tests/unit_tests tests/Traits"
"vendor/bin/phpcs --standard=phpcs_ruleset.xml src tests/Functional tests/unit_tests"
],
"code:lint": [
"@cs"
Expand All @@ -118,7 +118,7 @@
"SHELL_INTERACTIVE=true TERMINUS_TEST_MODE=1 behat --colors --config tests/config/behat.yml --stop-on-failure --suite=default"
],
"test:short": [
"XDEBUG_MODE=coverage vendor/bin/phpunit --colors=always -c ./phpunit.xml --debug --group=short --do-not-cache-result --verbose"
"XDEBUG_MODE=coverage vendor/bin/phpunit --colors=always -c ./phpunit.xml --debug --group=short --do-not-cache-result --verbose --stop-on-failure"
],
"test:long": [
"XDEBUG_MODE=coverage vendor/bin/phpunit --colors=always -c ./phpunit.xml --debug --group=long --do-not-cache-result --verbose"
Expand Down
Loading