From c5a299d19c9014fdc9541b13353239cc6d837228 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot <44816363+yoshi-automation@users.noreply.github.com> Date: Tue, 7 May 2019 10:35:00 -0700 Subject: [PATCH] build: only pipe to codecov if tests run in Node 10 (#215) --- .kokoro/lint.sh | 10 ++++++---- .kokoro/samples-test.sh | 16 +++++++++------- .kokoro/test.sh | 12 ++++++++++-- synth.metadata | 4 ++-- 4 files changed, 27 insertions(+), 15 deletions(-) diff --git a/.kokoro/lint.sh b/.kokoro/lint.sh index 7c2ea2a..bcb7508 100755 --- a/.kokoro/lint.sh +++ b/.kokoro/lint.sh @@ -23,9 +23,11 @@ cd $(dirname $0)/.. npm install # Install and link samples -cd samples/ -npm link ../ -npm install -cd .. +if [ -f samples/package.json ]; then + cd samples/ + npm link ../ + npm install + cd .. +fi npm run lint diff --git a/.kokoro/samples-test.sh b/.kokoro/samples-test.sh index 5a81ec0..f83f712 100755 --- a/.kokoro/samples-test.sh +++ b/.kokoro/samples-test.sh @@ -31,12 +31,14 @@ if [ -f .kokoro/pre-samples-test.sh ]; then set -x fi -npm install +if [ -f samples/package.json ]; then + npm install -# Install and link samples -cd samples/ -npm link ../ -npm install -cd .. + # Install and link samples + cd samples/ + npm link ../ + npm install + cd .. -npm run samples-test + npm run samples-test +fi diff --git a/.kokoro/test.sh b/.kokoro/test.sh index 4d6c3f8..f7e9fe7 100755 --- a/.kokoro/test.sh +++ b/.kokoro/test.sh @@ -22,6 +22,14 @@ cd $(dirname $0)/.. npm install npm test -./node_modules/nyc/bin/nyc.js report -bash $KOKORO_GFILE_DIR/codecov.sh +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 + fi + bash $KOKORO_GFILE_DIR/codecov.sh +else + echo "coverage is only reported for Node $COVERAGE_NODE" +fi diff --git a/synth.metadata b/synth.metadata index 15b2d52..9df4bef 100644 --- a/synth.metadata +++ b/synth.metadata @@ -1,11 +1,11 @@ { - "updateTime": "2019-03-08T00:45:34.510120Z", + "updateTime": "2019-05-04T11:06:20.683603Z", "sources": [ { "template": { "name": "node_library", "origin": "synthtool.gcp", - "version": "2019.1.16" + "version": "2019.5.2" } } ]