Skip to content

Commit 8cf3af1

Browse files
committed
test: optimize total Travis run time
* skip compilation by using cache * split testing into two jobs * DRY with YAML anchors PR-URL: #27182 Refs: #27158 Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Rich Trott <[email protected]>
1 parent 060d901 commit 8cf3af1

File tree

1 file changed

+36
-23
lines changed

1 file changed

+36
-23
lines changed

.travis.yml

+36-23
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
1+
x-ccache-setup-steps: &ccache-setup-steps
2+
- export CCACHE_NOSTATS=1
3+
- export CCACHE_SLOPPINESS="file_macro,include_file_mtime,include_file_ctime,time_macros,file_stat_matches"
4+
- export CC='ccache gcc-6'
5+
- export CXX='ccache g++-6'
6+
17
os: linux
28
dist: xenial
9+
language: cpp
310
jobs:
411
include:
512
- stage: "Lint and Compile"
@@ -21,49 +28,55 @@ jobs:
2128
- NODE=$(which node) make lint lint-py
2229

2330
- name: "Compile V8"
24-
language: cpp
2531
cache: ccache
2632
addons:
2733
apt:
2834
sources:
2935
- ubuntu-toolchain-r-test
3036
packages:
3137
- g++-6
32-
install:
33-
- CC='ccache gcc-6' CXX='ccache g++-6' ./configure
38+
install: *ccache-setup-steps
3439
script:
35-
- CC='ccache gcc-6' CXX='ccache g++-6' make -j2 -C out V=1 v8
40+
- ./configure
41+
- make -j2 -C out V=1 v8
3642

3743
- name: "Compile Node.js"
38-
language: cpp
3944
cache: ccache
4045
addons:
4146
apt:
4247
sources:
4348
- ubuntu-toolchain-r-test
4449
packages:
4550
- g++-6
46-
install:
47-
- CC='ccache gcc-6' CXX='ccache g++-6' ./configure
51+
install: *ccache-setup-steps
4852
script:
49-
- CC='ccache gcc-6' CXX='ccache g++-6' make -j2 V=1
53+
- ./configure
54+
- make -j2 V=1
55+
- cp out/Release/node /home/travis/.ccache
56+
- cp out/Release/cctest /home/travis/.ccache
5057

5158
- stage: "Tests"
52-
name: "Test Suite"
53-
language: cpp
59+
name: "Test JS Suites"
5460
cache: ccache
55-
addons:
56-
apt:
57-
sources:
58-
- ubuntu-toolchain-r-test
59-
packages:
60-
- g++-6
6161
install:
62-
- export CC='ccache gcc-6' CXX='ccache g++-6' JOBS=2
63-
- ./configure
64-
# We already have a compile log in the above job
65-
- make -j2 > /dev/null
66-
- make -j1 build-addons build-js-native-api-tests build-node-api-tests > /dev/null
62+
- mkdir -p out/Release
63+
- cp /home/travis/.ccache/node out/Release/node
64+
script:
65+
- python tools/test.py -j 2 -p dots --report --mode=release --flaky-tests=dontcare default
66+
67+
- name: "Test C++ Suites"
68+
cache: ccache
69+
install:
70+
- export CCACHE_NOSTATS=1
71+
- export CCACHE_SLOPPINESS="file_macro,include_file_mtime,include_file_ctime,time_macros,file_stat_matches"
72+
- export CC='ccache gcc'
73+
- export CXX='ccache g++'
74+
- mkdir -p out/Release
75+
- cp /home/travis/.ccache/node out/Release/node
76+
- ln -fs out/Release/node node
77+
- cp /home/travis/.ccache/cctest out/Release/cctest
78+
- touch config.gypi
6779
script:
68-
- set -o pipefail
69-
- JOBS=2 FLAKY_TESTS=dontcare make -s -j1 V= test-ci | grep -F -e "---" -e "..." -v
80+
- out/Release/cctest
81+
- make -j1 V=1 test/addons/.buildstamp test/js-native-api/.buildstamp test/node-api/.buildstamp
82+
- python tools/test.py -j 2 -p dots --report --mode=release --flaky-tests=dontcare addons js-native-api node-api

0 commit comments

Comments
 (0)