This repository has been archived by the owner on Oct 3, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add PHP 8 compatibility (#270)
- Loading branch information
Showing
47 changed files
with
399 additions
and
256 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,13 +64,13 @@ unit-config: &unit-config | |
|
||
- run: | ||
name: PHP unit tests | ||
command: vendor/bin/phpunit | ||
command: XDEBUG_MODE=coverage vendor/bin/phpunit | ||
|
||
- run: | ||
name: PHP unit tests with extension | ||
command: | | ||
if [ $RUN_EXTENSION_TESTS -eq "1" ]; then | ||
php -d extension=opencensus.so vendor/bin/phpunit | ||
XDEBUG_MODE=coverage php -d extension=opencensus.so vendor/bin/phpunit | ||
else | ||
echo "Skipping units tests with extension" | ||
fi | ||
|
@@ -107,29 +107,30 @@ jobs: | |
docker: | ||
- image: circleci/php:7.3-zts-node | ||
|
||
php71-32bit: | ||
php74: | ||
<<: *unit-config | ||
docker: | ||
- image: gcr.io/php-stackdriver/php71-32bit | ||
environment: | ||
TEST_PHP_ARGS: -q | ||
REPORT_EXIT_STATUS: 1 | ||
RUN_EXTENSION_TESTS: 1 | ||
SUDO_CMD: "" | ||
- image: circleci/php:7.4-node | ||
|
||
php71-debug: | ||
php74-zts: | ||
<<: *unit-config | ||
docker: | ||
- image: gcr.io/php-stackdriver/php71-debug | ||
environment: | ||
TEST_PHP_ARGS: -q | ||
REPORT_EXIT_STATUS: 1 | ||
RUN_EXTENSION_TESTS: 1 | ||
SUDO_CMD: "" | ||
- image: circleci/php:7.4-zts-node | ||
|
||
integration: | ||
php80: | ||
<<: *unit-config | ||
docker: | ||
- image: circleci/php:7.2-node | ||
- image: circleci/php:8.0-node | ||
|
||
php80-zts: | ||
<<: *unit-config | ||
docker: | ||
- image: circleci/php:8.0-zts-node | ||
|
||
# Integration tests running on PHP 7.4. When updating these, please also update `integration-8.0` further down. | ||
integration-7.4: | ||
docker: | ||
- image: circleci/php:7.4-node | ||
- image: memcached | ||
- image: mysql:5.7 | ||
environment: | ||
|
@@ -202,11 +203,13 @@ jobs: | |
- run: | ||
name: Pgsql test | ||
command: tests/integration/pgsql/test.sh | ||
- run: | ||
name: Symfony 4 test | ||
command: tests/integration/symfony4/test.sh | ||
environment: | ||
DATABASE_URL: mysql://mysql:[email protected]:3306/mysqldb | ||
# Skipped due to a dependency incompatibility between "cache/adapter-common" and "psr/cache". | ||
# TODO(mrmage): Re-enable this step once "cache/adapter-common" supports "psr/cache" v2.0/v3.0. | ||
# - run: | ||
# name: Symfony 4 test | ||
# command: tests/integration/symfony4/test.sh | ||
# environment: | ||
# DATABASE_URL: mysql://mysql:[email protected]:3306/mysqldb | ||
- run: | ||
name: Wordpress test | ||
command: tests/integration/wordpress/test.sh | ||
|
@@ -216,6 +219,100 @@ jobs: | |
DB_PASSWORD: mysql | ||
DB_DATABASE: mysqldb | ||
|
||
# Integration tests running on PHP 8.0. When updating these, please also update `integration-7.4` further down. | ||
integration-8.0: | ||
docker: | ||
- image: circleci/php:8.0-node | ||
- image: memcached | ||
- image: mysql:5.7 | ||
environment: | ||
MYSQL_USER: mysql | ||
MYSQL_PASSWORD: mysql | ||
MYSQL_DATABASE: mysqldb | ||
MYSQL_RANDOM_ROOT_PASSWORD: yes | ||
- image: postgres:9.6 | ||
environment: | ||
POSTGRES_PASSWORD: pgsql | ||
POSTGRES_USER: postgres | ||
steps: | ||
- checkout | ||
- run: | ||
name: Install build tools | ||
command: | | ||
sudo apt-get update -y | ||
sudo apt-get install -y -q --no-install-recommends \ | ||
build-essential \ | ||
g++ \ | ||
gcc \ | ||
libc-dev \ | ||
libpqxx-dev \ | ||
make \ | ||
autoconf \ | ||
git \ | ||
unzip | ||
- run: | ||
name: Install opencensus extension | ||
command: | | ||
cd ext | ||
phpize | ||
./configure --enable-opencensus | ||
sudo make install | ||
sudo docker-php-ext-enable opencensus | ||
- run: | ||
name: Install memcached extension | ||
command: | | ||
sudo apt-get install -y -q --no-install-recommends \ | ||
libmemcached11 libmemcached-dev zlib1g-dev zlib1g | ||
sudo pecl install memcached <<<'' | ||
sudo docker-php-ext-enable memcached | ||
- run: | ||
name: Install pdo_mysql extension | ||
command: sudo docker-php-ext-install pdo_mysql | ||
- run: | ||
name: Install mysqli extension | ||
command: sudo docker-php-ext-install mysqli | ||
- run: | ||
name: Install pgsql extension | ||
command: sudo docker-php-ext-install pgsql | ||
- run: | ||
name: Install pcntl extension | ||
command: sudo docker-php-ext-install pcntl | ||
- run: | ||
name: Curl test | ||
command: tests/integration/curl/test.sh | ||
- run: | ||
name: Guzzle 5 test | ||
command: tests/integration/guzzle5/test.sh | ||
- run: | ||
name: Guzzle 6 test | ||
command: tests/integration/guzzle6/test.sh | ||
- run: | ||
name: Laravel test | ||
command: tests/integration/laravel/test.sh | ||
- run: | ||
name: Memcached test | ||
command: tests/integration/memcached/test.sh | ||
- run: | ||
name: Pgsql test | ||
command: tests/integration/pgsql/test.sh | ||
# Skipped due to a dependency incompatibility between "cache/adapter-common" and "psr/cache". | ||
# TODO(mrmage): Re-enable this step once "cache/adapter-common" supports "psr/cache" v2.0/v3.0. | ||
# - run: | ||
# name: Symfony 4 test | ||
# command: tests/integration/symfony4/test.sh | ||
# environment: | ||
# DATABASE_URL: mysql://mysql:[email protected]:3306/mysqldb | ||
# Skipped because "wp-cli" is currently not compatible with PHP 8 (see https://github.com/wp-cli/wp-cli/issues/5452). | ||
# TODO(mrmage): Re-enable this step once "wp-cli" supports PHP 8. | ||
# - run: | ||
# name: Wordpress test | ||
# command: tests/integration/wordpress/test.sh | ||
environment: | ||
DB_HOST: 127.0.0.1 | ||
DB_USERNAME: mysql | ||
DB_PASSWORD: mysql | ||
DB_DATABASE: mysqldb | ||
|
||
workflows: | ||
version: 2 | ||
units: | ||
|
@@ -226,6 +323,9 @@ workflows: | |
- php72-zts | ||
- php73 | ||
- php73-zts | ||
- php71-32bit | ||
- php71-debug | ||
- integration | ||
- php74 | ||
- php74-zts | ||
- php80 | ||
- php80-zts | ||
- integration-7.4 | ||
- integration-8.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.