diff --git a/.kokoro/deploy_gae.cfg b/.kokoro/deploy_gae.cfg index 3b7a2d7645..105cd4561f 100644 --- a/.kokoro/deploy_gae.cfg +++ b/.kokoro/deploy_gae.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/php80" + value: "gcr.io/cloud-devrel-kokoro-resources/php-multi-test" } # Run the deployment tests diff --git a/.kokoro/deploy_gcf.cfg b/.kokoro/deploy_gcf.cfg index 243fbc7b69..351734c429 100644 --- a/.kokoro/deploy_gcf.cfg +++ b/.kokoro/deploy_gcf.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/php80" + value: "gcr.io/cloud-devrel-kokoro-resources/php-multi-test" } # Run the deployment tests diff --git a/.kokoro/deploy_misc.cfg b/.kokoro/deploy_misc.cfg index 8efc1b10f8..2adab9ec79 100644 --- a/.kokoro/deploy_misc.cfg +++ b/.kokoro/deploy_misc.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/php80" + value: "gcr.io/cloud-devrel-kokoro-resources/php-multi-test" } # Run the deployment tests diff --git a/.kokoro/lint.cfg b/.kokoro/lint.cfg new file mode 100644 index 0000000000..43ac7fa51e --- /dev/null +++ b/.kokoro/lint.cfg @@ -0,0 +1,12 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/php-multi-test" +} + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/php-docs-samples/testing/run_cs_check.sh" +} diff --git a/.kokoro/php80.cfg b/.kokoro/php80.cfg index f5837873dc..2c745a7a33 100644 --- a/.kokoro/php80.cfg +++ b/.kokoro/php80.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/php80" + value: "gcr.io/cloud-devrel-kokoro-resources/php-multi-test" } # Give the docker image a unique project ID and credentials per PHP version diff --git a/.kokoro/php81.cfg b/.kokoro/php81.cfg index 1b7a81d36a..d08cfa24a2 100644 --- a/.kokoro/php81.cfg +++ b/.kokoro/php81.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/php81" + value: "gcr.io/cloud-devrel-kokoro-resources/php-multi-test" } # Give the docker image a unique project ID and credentials per PHP version diff --git a/.kokoro/php82.cfg b/.kokoro/php82.cfg index 824663d40a..bd7d481e5e 100644 --- a/.kokoro/php82.cfg +++ b/.kokoro/php82.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/php82" + value: "gcr.io/cloud-devrel-kokoro-resources/php-multi-test" } # Give the docker image a unique project ID and credentials per PHP version diff --git a/.kokoro/php_rest.cfg b/.kokoro/php_rest.cfg index 650b018bfa..459d4fadf5 100644 --- a/.kokoro/php_rest.cfg +++ b/.kokoro/php_rest.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/php80" + value: "gcr.io/cloud-devrel-kokoro-resources/php-multi-test" } # Set this project to run REST tests only diff --git a/.kokoro/system_tests.sh b/.kokoro/system_tests.sh index 5c286a2ad1..d174f29354 100755 --- a/.kokoro/system_tests.sh +++ b/.kokoro/system_tests.sh @@ -50,10 +50,26 @@ mkdir -p build/logs export PULL_REQUEST_NUMBER=$KOKORO_GITHUB_PULL_REQUEST_NUMBER +# Load phpbrew shell +source /root/.phpbrew/bashrc + +# Decide which php version to use. +if [ "3" -eq ${GOOGLE_ALT_PROJECT_ID: -1} ]; then + PHP_VERSION="7.3" +elif [ "1" -eq ${GOOGLE_ALT_PROJECT_ID: -1} ]; then + PHP_VERSION="7.4" +elif [ "2" -eq ${GOOGLE_ALT_PROJECT_ID: -1} ]; then + PHP_VERSION="8.0" +else + # By default use PHP 7.4 + PHP_VERSION="7.4" +fi + +phpbrew switch $(phpbrew list | grep $PHP_VERSION | cut -c 2-) + # If we are running REST tests, disable gRPC if [ "${RUN_REST_TESTS_ONLY}" = "true" ]; then - GRPC_INI=$(php -i | grep grpc.ini | sed 's/^Additional .ini files parsed => //g' | sed 's/,*$//g' ) - mv $GRPC_INI "${GRPC_INI}.disabled" + phpbrew ext disable grpc fi # Install global test dependencies diff --git a/testing/run_cs_check.sh b/testing/run_cs_check.sh index 69b7199c98..ab2a964a51 100755 --- a/testing/run_cs_check.sh +++ b/testing/run_cs_check.sh @@ -22,7 +22,7 @@ DIR="${1:-$PROJECT_ROOT}" cd "$PROJECT_ROOT" # install local version of php-cs-fixer 3.0 from composer.json -composer -q install -d testing/ +composer install -d testing/ # run php-cs-fixer PHP_CS_FIXER="php-cs-fixer"