Skip to content

Commit 59f5f72

Browse files
bcoeJustinBeckwith
authored andcommitted
build: add new kokoro config for coverage and release-please (#713)
* build: add new kokoro config for release-please and coverage * build: actually commit the config * fix: do not fail test if nyc did not run
1 parent 3ee1a2c commit 59f5f72

14 files changed

+153
-30
lines changed

.kokoro/continuous/node10/common.cfg

+10
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,16 @@ action {
77
}
88
}
99

10+
# Bring in codecov.io master token into the build as $KOKORO_KEYSTORE_DIR/73713_dpebot_codecov_token
11+
before_action {
12+
fetch_keystore {
13+
keystore_resource {
14+
keystore_config_id: 73713
15+
keyname: "dpebot_codecov_token"
16+
}
17+
}
18+
}
19+
1020
# Download trampoline resources.
1121
gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline"
1222

.kokoro/continuous/node10/test.cfg

-9
Original file line numberDiff line numberDiff line change
@@ -1,9 +0,0 @@
1-
# Bring in codecov.io master token into the build as $KOKORO_KEYSTORE_DIR/73713_dpebot_codecov_token
2-
before_action {
3-
fetch_keystore {
4-
keystore_resource {
5-
keystore_config_id: 73713
6-
keyname: "dpebot_codecov_token"
7-
}
8-
}
9-
}

.kokoro/presubmit/node10/common.cfg

+10
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,16 @@ action {
77
}
88
}
99

10+
# Bring in codecov.io master token into the build as $KOKORO_KEYSTORE_DIR/73713_dpebot_codecov_token
11+
before_action {
12+
fetch_keystore {
13+
keystore_resource {
14+
keystore_config_id: 73713
15+
keyname: "dpebot_codecov_token"
16+
}
17+
}
18+
}
19+
1020
# Download trampoline resources.
1121
gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline"
1222

.kokoro/presubmit/node10/test.cfg

-9
Original file line numberDiff line numberDiff line change
@@ -1,9 +0,0 @@
1-
# Bring in codecov.io master token into the build as $KOKORO_KEYSTORE_DIR/73713_dpebot_codecov_token
2-
before_action {
3-
fetch_keystore {
4-
keystore_resource {
5-
keystore_config_id: 73713
6-
keyname: "dpebot_codecov_token"
7-
}
8-
}
9-
}

.kokoro/release-candidate-issue.sh

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/bin/bash
2+
3+
# Copyright 2019 Google LLC
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+
# https://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 -eo pipefail
18+
19+
export NPM_CONFIG_PREFIX=/home/node/.npm-global
20+
21+
GITHUB_TOKEN=$(cat $KOKORO_KEYSTORE_DIR/73713_yoshi-automation-github-key)
22+
23+
npx release-please candidate-issue --token=$GITHUB_TOKEN \
24+
--repo-url=googleapis/nodejs-storage \
25+
--package-name=@google-cloud/storage

.kokoro/release-requested.sh

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/bin/bash
2+
3+
# Copyright 2019 Google LLC
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+
# https://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 -eo pipefail
18+
19+
export NPM_CONFIG_PREFIX=/home/node/.npm-global
20+
21+
GITHUB_TOKEN=$(cat $KOKORO_KEYSTORE_DIR/73713_yoshi-automation-github-key)
22+
23+
npx release-please detect-checked --token=$GITHUB_TOKEN \
24+
--repo-url=googleapis/nodejs-storage \
25+
--package-name=@google-cloud/storage

.kokoro/release/common.cfg

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
before_action {
2+
fetch_keystore {
3+
keystore_resource {
4+
keystore_config_id: 73713
5+
keyname: "yoshi-automation-github-key"
6+
}
7+
}
8+
}

.kokoro/release/publish.cfg

-9
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,6 @@ before_action {
99
}
1010
}
1111

12-
before_action {
13-
fetch_keystore {
14-
keystore_resource {
15-
keystore_config_id: 73713
16-
keyname: "yoshi-automation-github-key"
17-
}
18-
}
19-
}
20-
2112
before_action {
2213
fetch_keystore {
2314
keystore_resource {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Build logs will be here
2+
action {
3+
define_artifacts {
4+
regex: "**/*sponge_log.xml"
5+
}
6+
}
7+
8+
# Download trampoline resources.
9+
gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline"
10+
11+
# Use the trampoline script to run in docker.
12+
build_file: "nodejs-storage/.kokoro/trampoline.sh"
13+
14+
# Configure the docker image for kokoro-trampoline.
15+
env_vars: {
16+
key: "TRAMPOLINE_IMAGE"
17+
value: "gcr.io/cloud-devrel-kokoro-resources/node:10-user"
18+
}
19+
env_vars: {
20+
key: "TRAMPOLINE_BUILD_FILE"
21+
value: "github/nodejs-storage/.kokoro/release-candidate-issue.sh"
22+
}

.kokoro/release/release-requested.cfg

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Build logs will be here
2+
action {
3+
define_artifacts {
4+
regex: "**/*sponge_log.xml"
5+
}
6+
}
7+
8+
# Download trampoline resources.
9+
gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline"
10+
11+
# Use the trampoline script to run in docker.
12+
build_file: "nodejs-storage/.kokoro/trampoline.sh"
13+
14+
# Configure the docker image for kokoro-trampoline.
15+
env_vars: {
16+
key: "TRAMPOLINE_IMAGE"
17+
value: "gcr.io/cloud-devrel-kokoro-resources/node:10-user"
18+
}
19+
env_vars: {
20+
key: "TRAMPOLINE_BUILD_FILE"
21+
value: "github/nodejs-storage/.kokoro/release-requested.sh"
22+
}

.kokoro/samples-test.sh

+13
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,16 @@ if [ -f samples/package.json ]; then
4242

4343
npm run samples-test
4444
fi
45+
46+
# codecov combines coverage across integration and unit tests. Include
47+
# the logic below for any environment you wish to collect coverage for:
48+
COVERAGE_NODE=10
49+
if npx check-node-version@3.3.0 --silent --node $COVERAGE_NODE; then
50+
NYC_BIN=./node_modules/nyc/bin/nyc.js
51+
if [ -f "$NYC_BIN" ]; then
52+
$NYC_BIN report || true
53+
fi
54+
bash $KOKORO_GFILE_DIR/codecov.sh
55+
else
56+
echo "coverage is only reported for Node $COVERAGE_NODE"
57+
fi

.kokoro/system-test.sh

+13
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,16 @@ fi
3434
npm install
3535

3636
npm run system-test
37+
38+
# codecov combines coverage across integration and unit tests. Include
39+
# the logic below for any environment you wish to collect coverage for:
40+
COVERAGE_NODE=10
41+
if npx check-node-version@3.3.0 --silent --node $COVERAGE_NODE; then
42+
NYC_BIN=./node_modules/nyc/bin/nyc.js
43+
if [ -f "$NYC_BIN" ]; then
44+
$NYC_BIN report || true
45+
fi
46+
bash $KOKORO_GFILE_DIR/codecov.sh
47+
else
48+
echo "coverage is only reported for Node $COVERAGE_NODE"
49+
fi

.kokoro/test.sh

+3-1
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,13 @@ cd $(dirname $0)/..
2323
npm install
2424
npm test
2525

26+
# codecov combines coverage across integration and unit tests. Include
27+
# the logic below for any environment you wish to collect coverage for:
2628
COVERAGE_NODE=10
2729
if npx check-node-version@3.3.0 --silent --node $COVERAGE_NODE; then
2830
NYC_BIN=./node_modules/nyc/bin/nyc.js
2931
if [ -f "$NYC_BIN" ]; then
30-
$NYC_BIN report
32+
$NYC_BIN report || true
3133
fi
3234
bash $KOKORO_GFILE_DIR/codecov.sh
3335
else

synth.metadata

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"updateTime": "2019-05-04T11:22:40.672305Z",
2+
"updateTime": "2019-05-17T01:12:33.148151Z",
33
"sources": [
44
{
55
"template": {
66
"name": "node_library",
77
"origin": "synthtool.gcp",
8-
"version": "2019.5.2"
8+
"version": "2019.4.10"
99
}
1010
}
1111
]

0 commit comments

Comments
 (0)