Skip to content

Commit b361eb2

Browse files
yoshi-automationbcoe
authored andcommitted
build: only pipe to codecov if tests run on Node 10
1 parent d3d3728 commit b361eb2

File tree

4 files changed

+27
-15
lines changed

4 files changed

+27
-15
lines changed

.kokoro/lint.sh

+6-4
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,11 @@ cd $(dirname $0)/..
2323
npm install
2424

2525
# Install and link samples
26-
cd samples/
27-
npm link ../
28-
npm install
29-
cd ..
26+
if [ -f samples/package.json ]; then
27+
cd samples/
28+
npm link ../
29+
npm install
30+
cd ..
31+
fi
3032

3133
npm run lint

.kokoro/samples-test.sh

+9-7
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,14 @@ if [ -f .kokoro/pre-samples-test.sh ]; then
3131
set -x
3232
fi
3333

34-
npm install
34+
if [ -f samples/package.json ]; then
35+
npm install
3536

36-
# Install and link samples
37-
cd samples/
38-
npm link ../
39-
npm install
40-
cd ..
37+
# Install and link samples
38+
cd samples/
39+
npm link ../
40+
npm install
41+
cd ..
4142

42-
npm run samples-test
43+
npm run samples-test
44+
fi

.kokoro/test.sh

+10-2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,14 @@ cd $(dirname $0)/..
2222

2323
npm install
2424
npm test
25-
./node_modules/nyc/bin/nyc.js report
2625

27-
bash $KOKORO_GFILE_DIR/codecov.sh
26+
COVERAGE_NODE=10
27+
if npx check-node-version@3.3.0 --silent --node $COVERAGE_NODE; then
28+
NYC_BIN=./node_modules/nyc/bin/nyc.js
29+
if [ -f "$NYC_BIN" ]; then
30+
$NYC_BIN report
31+
fi
32+
bash $KOKORO_GFILE_DIR/codecov.sh
33+
else
34+
echo "coverage is only reported for Node $COVERAGE_NODE"
35+
fi

synth.metadata

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

0 commit comments

Comments
 (0)