Skip to content

Commit 27698a1

Browse files
author
Ace Nassri
authored
Merge pull request GoogleCloudPlatform#1323 from GoogleCloudPlatform/add-subdir-var
feat(Kokoro): add sub-directory support + split out lint build
2 parents 3d97183 + c41448f commit 27698a1

File tree

3 files changed

+52
-1
lines changed

3 files changed

+52
-1
lines changed

.kokoro/lint.cfg

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Format: //devtools/kokoro/config/proto/build.proto
2+
3+
# Configure the docker image for kokoro-trampoline.
4+
env_vars: {
5+
key: "TRAMPOLINE_IMAGE"
6+
value: "gcr.io/cloud-devrel-kokoro-resources/php74"
7+
}
8+
9+
env_vars: {
10+
key: "RUN_CS_CHECK"
11+
value: "true"
12+
}

.kokoro/lint.sh

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/bin/bash
2+
3+
# Copyright 2021 Google Inc.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
set -e
18+
19+
if [ "${BASH_DEBUG}" = "true" ]; then
20+
set -x
21+
fi
22+
23+
# Kokoro directory for running these samples
24+
cd github/php-docs-samples
25+
26+
mkdir -p build/logs
27+
28+
export PULL_REQUEST_NUMBER=$KOKORO_GITHUB_PULL_REQUEST_NUMBER
29+
30+
# Run code standards check when appropriate
31+
if [ "${RUN_CS_CHECK}" = "true" ]; then
32+
bash testing/run_cs_check.sh
33+
fi

.kokoro/system_tests.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,5 +64,11 @@ fi
6464
# Install global test dependencies
6565
composer install -d testing/
6666

67+
# cd into specific subdirectory (if appropriate)
68+
MAIN_DIR=$(pwd)
69+
if [ ! -z "${SUB_DIRECTORY}" ]; then
70+
cd $SUB_DIRECTORY
71+
fi
72+
6773
# Run tests
68-
bash testing/run_test_suite.sh
74+
bash $MAIN_DIR/testing/run_test_suite.sh

0 commit comments

Comments
 (0)