diff --git a/.kokoro/lint.cfg b/.kokoro/lint.cfg new file mode 100644 index 0000000000..160ca627cb --- /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/php74" +} + +env_vars: { + key: "RUN_CS_CHECK" + value: "true" +} diff --git a/.kokoro/lint.sh b/.kokoro/lint.sh new file mode 100755 index 0000000000..b8c2df59de --- /dev/null +++ b/.kokoro/lint.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +# Copyright 2021 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -e + +if [ "${BASH_DEBUG}" = "true" ]; then + set -x +fi + +# Kokoro directory for running these samples +cd github/php-docs-samples + +mkdir -p build/logs + +export PULL_REQUEST_NUMBER=$KOKORO_GITHUB_PULL_REQUEST_NUMBER + +# Run code standards check when appropriate +if [ "${RUN_CS_CHECK}" = "true" ]; then + bash testing/run_cs_check.sh +fi diff --git a/.kokoro/system_tests.sh b/.kokoro/system_tests.sh index a577256234..fe27d64fe0 100755 --- a/.kokoro/system_tests.sh +++ b/.kokoro/system_tests.sh @@ -64,5 +64,11 @@ fi # Install global test dependencies composer install -d testing/ +# cd into specific subdirectory (if appropriate) +MAIN_DIR=$(pwd) +if [ ! -z "${SUB_DIRECTORY}" ]; then + cd $SUB_DIRECTORY +fi + # Run tests -bash testing/run_test_suite.sh +bash $MAIN_DIR/testing/run_test_suite.sh