Skip to content

Commit

Permalink
build: add new kokoro config for coverage and release-please (#631)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
bcoe authored and JustinBeckwith committed May 17, 2019
1 parent b4438f7 commit 62eaab0
Show file tree
Hide file tree
Showing 15 changed files with 155 additions and 33 deletions.
10 changes: 10 additions & 0 deletions .kokoro/continuous/node10/common.cfg
Expand Up @@ -7,6 +7,16 @@ action {
}
}

# Bring in codecov.io master token into the build as $KOKORO_KEYSTORE_DIR/73713_dpebot_codecov_token
before_action {
fetch_keystore {
keystore_resource {
keystore_config_id: 73713
keyname: "dpebot_codecov_token"
}
}
}

# Download trampoline resources.
gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline"

Expand Down
9 changes: 0 additions & 9 deletions .kokoro/continuous/node10/test.cfg
@@ -1,9 +0,0 @@
# Bring in codecov.io master token into the build as $KOKORO_KEYSTORE_DIR/73713_dpebot_codecov_token
before_action {
fetch_keystore {
keystore_resource {
keystore_config_id: 73713
keyname: "dpebot_codecov_token"
}
}
}
10 changes: 10 additions & 0 deletions .kokoro/presubmit/node10/common.cfg
Expand Up @@ -7,6 +7,16 @@ action {
}
}

# Bring in codecov.io master token into the build as $KOKORO_KEYSTORE_DIR/73713_dpebot_codecov_token
before_action {
fetch_keystore {
keystore_resource {
keystore_config_id: 73713
keyname: "dpebot_codecov_token"
}
}
}

# Download trampoline resources.
gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline"

Expand Down
9 changes: 0 additions & 9 deletions .kokoro/presubmit/node10/test.cfg
@@ -1,9 +0,0 @@
# Bring in codecov.io master token into the build as $KOKORO_KEYSTORE_DIR/73713_dpebot_codecov_token
before_action {
fetch_keystore {
keystore_resource {
keystore_config_id: 73713
keyname: "dpebot_codecov_token"
}
}
}
25 changes: 25 additions & 0 deletions .kokoro/release-candidate-issue.sh
@@ -0,0 +1,25 @@
#!/bin/bash

# Copyright 2019 Google LLC
#
# 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
#
# https://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 -eo pipefail

export NPM_CONFIG_PREFIX=/home/node/.npm-global

GITHUB_TOKEN=$(cat $KOKORO_KEYSTORE_DIR/73713_yoshi-automation-github-key)

npx release-please candidate-issue --token=$GITHUB_TOKEN \
--repo-url=googleapis/nodejs-firestore \
--package-name=@google-cloud/firestore
25 changes: 25 additions & 0 deletions .kokoro/release-requested.sh
@@ -0,0 +1,25 @@
#!/bin/bash

# Copyright 2019 Google LLC
#
# 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
#
# https://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 -eo pipefail

export NPM_CONFIG_PREFIX=/home/node/.npm-global

GITHUB_TOKEN=$(cat $KOKORO_KEYSTORE_DIR/73713_yoshi-automation-github-key)

npx release-please detect-checked --token=$GITHUB_TOKEN \
--repo-url=googleapis/nodejs-firestore \
--package-name=@google-cloud/firestore
8 changes: 8 additions & 0 deletions .kokoro/release/common.cfg
@@ -0,0 +1,8 @@
before_action {
fetch_keystore {
keystore_resource {
keystore_config_id: 73713
keyname: "yoshi-automation-github-key"
}
}
}
9 changes: 0 additions & 9 deletions .kokoro/release/publish.cfg
Expand Up @@ -9,15 +9,6 @@ before_action {
}
}

before_action {
fetch_keystore {
keystore_resource {
keystore_config_id: 73713
keyname: "yoshi-automation-github-key"
}
}
}

before_action {
fetch_keystore {
keystore_resource {
Expand Down
22 changes: 22 additions & 0 deletions .kokoro/release/release-candidate-issue.cfg
@@ -0,0 +1,22 @@
# Build logs will be here
action {
define_artifacts {
regex: "**/*sponge_log.xml"
}
}

# Download trampoline resources.
gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline"

# Use the trampoline script to run in docker.
build_file: "nodejs-firestore/.kokoro/trampoline.sh"

# Configure the docker image for kokoro-trampoline.
env_vars: {
key: "TRAMPOLINE_IMAGE"
value: "gcr.io/cloud-devrel-kokoro-resources/node:10-user"
}
env_vars: {
key: "TRAMPOLINE_BUILD_FILE"
value: "github/nodejs-firestore/.kokoro/release-candidate-issue.sh"
}
22 changes: 22 additions & 0 deletions .kokoro/release/release-requested.cfg
@@ -0,0 +1,22 @@
# Build logs will be here
action {
define_artifacts {
regex: "**/*sponge_log.xml"
}
}

# Download trampoline resources.
gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline"

# Use the trampoline script to run in docker.
build_file: "nodejs-firestore/.kokoro/trampoline.sh"

# Configure the docker image for kokoro-trampoline.
env_vars: {
key: "TRAMPOLINE_IMAGE"
value: "gcr.io/cloud-devrel-kokoro-resources/node:10-user"
}
env_vars: {
key: "TRAMPOLINE_BUILD_FILE"
value: "github/nodejs-firestore/.kokoro/release-requested.sh"
}
13 changes: 13 additions & 0 deletions .kokoro/samples-test.sh
Expand Up @@ -42,3 +42,16 @@ if [ -f samples/package.json ]; then

npm run samples-test
fi

# codecov combines coverage across integration and unit tests. Include
# the logic below for any environment you wish to collect coverage for:
COVERAGE_NODE=10
if npx check-node-version@3.3.0 --silent --node $COVERAGE_NODE; then
NYC_BIN=./node_modules/nyc/bin/nyc.js
if [ -f "$NYC_BIN" ]; then
$NYC_BIN report || true
fi
bash $KOKORO_GFILE_DIR/codecov.sh
else
echo "coverage is only reported for Node $COVERAGE_NODE"
fi
13 changes: 13 additions & 0 deletions .kokoro/system-test.sh
Expand Up @@ -34,3 +34,16 @@ fi
npm install

npm run system-test

# codecov combines coverage across integration and unit tests. Include
# the logic below for any environment you wish to collect coverage for:
COVERAGE_NODE=10
if npx check-node-version@3.3.0 --silent --node $COVERAGE_NODE; then
NYC_BIN=./node_modules/nyc/bin/nyc.js
if [ -f "$NYC_BIN" ]; then
$NYC_BIN report || true
fi
bash $KOKORO_GFILE_DIR/codecov.sh
else
echo "coverage is only reported for Node $COVERAGE_NODE"
fi
4 changes: 3 additions & 1 deletion .kokoro/test.sh
Expand Up @@ -23,11 +23,13 @@ cd $(dirname $0)/..
npm install
npm test

# codecov combines coverage across integration and unit tests. Include
# the logic below for any environment you wish to collect coverage for:
COVERAGE_NODE=10
if npx check-node-version@3.3.0 --silent --node $COVERAGE_NODE; then
NYC_BIN=./node_modules/nyc/bin/nyc.js
if [ -f "$NYC_BIN" ]; then
$NYC_BIN report
$NYC_BIN report || true
fi
bash $KOKORO_GFILE_DIR/codecov.sh
else
Expand Down
1 change: 0 additions & 1 deletion .nycrc
Expand Up @@ -10,7 +10,6 @@
"**/samples",
"**/scripts",
"**/src/**/v*/**/*.js",
"**/protos",
"**/test",
".jsdoc.js",
"**/.jsdoc.js",
Expand Down
8 changes: 4 additions & 4 deletions synth.metadata
@@ -1,5 +1,5 @@
{
"updateTime": "2019-05-15T11:15:06.294845Z",
"updateTime": "2019-05-17T01:06:11.402970Z",
"sources": [
{
"generator": {
Expand All @@ -12,15 +12,15 @@
"git": {
"name": "googleapis",
"remote": "https://github.com/googleapis/googleapis.git",
"sha": "275cdfcdc3188a60456f43acd139b8cc037379f4",
"internalRef": "248217300"
"sha": "03269e767cff9dd644d7784a4d4350b2ba6daf69",
"internalRef": "248524261"
}
},
{
"template": {
"name": "node_library",
"origin": "synthtool.gcp",
"version": "2019.5.2"
"version": "2019.4.10"
}
}
],
Expand Down

0 comments on commit 62eaab0

Please sign in to comment.