Skip to content

Commit 53bd845

Browse files
akosthekissyichoi
authored andcommitted
Move (almost all) Travis CI jobs to container-based infrastructure (#2333)
Container-based VMs promise significantly faster boot times. More or less related changes: - Added a JOBNAME to all jobs. - Added `install-noapt` target to several Makefile.travis files to avoid `sudo apt-get install ...` steps. Those installations are now handled by the apt addon of Travis. The `install` targets are kept anyway to keep the makefiles self-contained. - Removed a legacy workaround from the Coverity Scan job as it isn't necessary anymore to fiddle with the cerificates of scan.coverity.com. - Fixed the Mbed and the Zephyr jobs. JerryScript-DCO-1.0-Signed-off-by: Akos Kiss [email protected]
1 parent 19451fa commit 53bd845

File tree

8 files changed

+149
-67
lines changed

8 files changed

+149
-67
lines changed

.travis.yml

Lines changed: 114 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,12 @@
11
language: c
22

3-
# Default test platform: Ubuntu Trusty with sudo support.
3+
# Default environment: Container-based (sudo-less) Ubuntu Trusty 14.04.
44
os: linux
55
dist: trusty
6-
sudo: required
6+
sudo: false
77

8-
# Default dependency installation step #1: install dependencies for linux.
9-
# Other platforms can change this by redefining the 'before_install' stage in
10-
# the matrix below.
11-
before_install: tools/apt-get-install-deps.sh
12-
13-
# Default dependency installation step #2: nop intentionally.
14-
# Jobs can add their own dependencies on top of 'before_install' by redefinig
15-
# the 'install' stage in the matrix below.
8+
# Default dependency installation step: nop intentionally.
9+
# Jobs can add their own dependencies by redefinig the 'install' stage in the matrix below.
1610
install: true
1711

1812
# Default job task: run tests as defined in the $OPT environment variable.
@@ -22,23 +16,88 @@ script: tools/run-tests.py $OPTS
2216
# All the job definitions in the matrix.
2317
matrix:
2418
include:
25-
- env: OPTS="--check-signed-off=travis --check-cppcheck --check-doxygen --check-vera --check-license --check-magic-strings --check-pylint"
19+
- env:
20+
- JOBNAME="Checks"
21+
- OPTS="--check-signed-off=travis --check-cppcheck --check-doxygen --check-vera --check-license --check-magic-strings --check-pylint"
2622
install: pip install --user pylint==1.6.5
27-
- env: OPTS="--jerry-debugger"
28-
- env: OPTS="--quiet --jerry-tests --jerry-test-suite"
29-
- env: OPTS="--quiet --jerry-tests --jerry-test-suite --toolchain=cmake/toolchain_linux_armv7l.cmake" TIMEOUT=300
30-
install: tools/apt-get-install-qemu-arm.sh
31-
- env: OPTS="--buildoption-test"
32-
- env: OPTS="--quiet --jerry-tests --jerry-test-suite --buildoptions=--jerry-libc=off,--compile-flag=-m32,--cpointer-32bit=on"
33-
- env: OPTS="--unittests"
34-
- env: OPTS="--unittests --buildoptions=--cmake-param=-DFEATURE_INIT_FINI=ON"
35-
- env: OPTS="--test262"
36-
install: sudo timedatectl set-timezone America/Los_Angeles
37-
- os: osx
38-
before_install: tools/brew-install-deps.sh
39-
env: OPTS="--quiet --jerry-tests --jerry-test-suite --unittests"
40-
- install: echo -n | openssl s_client -connect scan.coverity.com:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | sudo tee -a /etc/ssl/certs/ca-
41-
env:
23+
addons:
24+
apt:
25+
packages: [doxygen, cppcheck, vera++]
26+
27+
- env:
28+
- JOBNAME="Linux/x86-64 Build & Correctness Tests"
29+
- OPTS="--quiet --jerry-tests --jerry-test-suite"
30+
31+
- env:
32+
- JOBNAME="Linux/x86 (cpointer-32bit) Build & Correctness Tests"
33+
- OPTS="--quiet --jerry-tests --jerry-test-suite --buildoptions=--jerry-libc=off,--compile-flag=-m32,--cpointer-32bit=on"
34+
addons:
35+
apt:
36+
packages: [gcc-multilib]
37+
38+
- env:
39+
- JOBNAME="Linux/ARM Build & Correctness Tests"
40+
- OPTS="--quiet --jerry-tests --jerry-test-suite --toolchain=cmake/toolchain_linux_armv7l.cmake"
41+
- TIMEOUT=300
42+
sudo: true # keep on sudo-enabled VM to allow qemu to register itself to binfmt_misc
43+
addons:
44+
apt:
45+
packages: [gcc-arm-linux-gnueabihf, libc6-dev-armhf-cross, qemu-user-static]
46+
47+
- env:
48+
- JOBNAME="OSX/x86-64 Build, Correctness & Unit Tests"
49+
- OPTS="--quiet --jerry-tests --jerry-test-suite --unittests"
50+
os: osx
51+
install: tools/brew-install-deps.sh
52+
53+
- env:
54+
- JOBNAME="Build Tests"
55+
- OPTS="--buildoption-test"
56+
addons:
57+
apt:
58+
packages: [gcc-multilib]
59+
60+
- env:
61+
- JOBNAME="Unit Tests"
62+
- OPTS="--unittests"
63+
64+
- env:
65+
- JOBNAME="Unit Tests (INIT_FINI)"
66+
- OPTS="--unittests --buildoptions=--cmake-param=-DFEATURE_INIT_FINI=ON"
67+
68+
- env:
69+
- JOBNAME="Debugger Tests"
70+
- OPTS="--jerry-debugger"
71+
72+
- env:
73+
- JOBNAME="Conformance Tests"
74+
- OPTS="--test262"
75+
- TZ=America/Los_Angeles
76+
77+
- env:
78+
- JOBNAME="ASAN Tests"
79+
- OPTS="--quiet --jerry-tests --jerry-test-suite --skip-list=parser-oom.js --buildoptions=--compile-flag=-fsanitize=address,--compile-flag=-m32,--compile-flag=-fno-omit-frame-pointer,--compile-flag=-fno-common,--compile-flag=-O2,--debug,--jerry-libc=off,--static-link=off,--system-allocator=on,--linker-flag=-fuse-ld=gold"
80+
- ASAN_OPTIONS=detect_stack_use_after_return=1:check_initialization_order=true:strict_init_order=true
81+
- TIMEOUT=600
82+
compiler: gcc-5
83+
addons:
84+
apt:
85+
sources: ubuntu-toolchain-r-test
86+
packages: [gcc-5, gcc-5-multilib]
87+
88+
- env:
89+
- JOBNAME="UBSAN Tests"
90+
- OPTS="--quiet --jerry-tests --jerry-test-suite --skip-list=parser-oom.js --buildoptions=--compile-flag=-fsanitize=undefined,--compile-flag=-m32,--compile-flag=-fno-omit-frame-pointer,--compile-flag=-fno-common,--debug,--jerry-libc=off,--static-link=off,--system-allocator=on,--linker-flag=-fuse-ld=gold"
91+
- UBSAN_OPTIONS=print_stacktrace=1
92+
- TIMEOUT=600
93+
compiler: gcc-5
94+
addons:
95+
apt:
96+
sources: ubuntu-toolchain-r-test
97+
packages: [gcc-5, gcc-5-multilib]
98+
99+
- env:
100+
- JOBNAME="Coverity Scan"
42101
# Declaration of the encrypted COVERITY_SCAN_TOKEN, created via the
43102
# "travis encrypt" command using the project repo's public key.
44103
- secure: "V7BdXv3FCVkFGEfKfWto6I+Sytou1zTCGyn49xurkBfKNsG/3vbkXfsbK1m6lCZxmY7W/1odpfjixpAPZgy2L4FgPZK6/UyVvC8pIFjDOubcEniN48haleSvm/ZFPLDifxDL2+VVFtK1oRYPtDBzzSoUCcfwovgk+Wy+tSBnhnyRLqO/WaI6PqFof7ECYMTRlJVjioZARVP4YmkBruIPmGDdR/3EvwowlxfuiFoPheix61ug4x3tpTBW2qWgvFjDyCZXFz4pJrBQPTAIbyKMxHcBykJjl9eR+dWAOsvE1Uw48tFOJxjKDfUttVQUPsyKFllmcCVS0fDYB5pzZOmRUPxJmox1jt8J1FY85Ri1PGY0THBPM2H7to4Yf2418Y3539epbN8p+79dwaM7e2OiJ2owukbWI7PoNqIz5DV5zxpIKsOQfeWuNLJOgsBePEIU7lz133Si/2d5W/7If46B1d+hZRBJfSYksgDqDU6G/voZkPf0K5bKe2O2BxiIW1DYk4yQ1ecZAkqGjZ8jG3zYGMG3mSF4VyuU4UGFG1Pg8fw7Ap5zuHxSVY1H9dtu4T6JQG3aj/x1omlzfw48DjgkwxVhf7Xvl3yfR7pzydYheLX3MZYtcVo7rWnglZFZoUjWDK1StbmzsvPftvwWtoDTWlzo4xeSXhahSJvJyc4U8Wc="
@@ -51,24 +110,7 @@ matrix:
51110
build_command: "tools/build.py --clean"
52111
branch_pattern: master
53112
script: true # Changed to nop, Coverity Scan has already built the project by the time 'script' stage is reached.
54-
- compiler: gcc-5
55-
addons:
56-
apt:
57-
sources:
58-
- ubuntu-toolchain-r-test
59-
packages:
60-
- gcc-5
61-
- gcc-5-multilib
62-
env: OPTS="--quiet --jerry-tests --jerry-test-suite --skip-list=parser-oom.js --buildoptions=--compile-flag=-fsanitize=address,--compile-flag=-m32,--compile-flag=-fno-omit-frame-pointer,--compile-flag=-fno-common,--compile-flag=-O2,--debug,--jerry-libc=off,--static-link=off,--system-allocator=on,--linker-flag=-fuse-ld=gold" ASAN_OPTIONS=detect_stack_use_after_return=1:check_initialization_order=true:strict_init_order=true TIMEOUT=600
63-
- compiler: gcc-5
64-
addons:
65-
apt:
66-
sources:
67-
- ubuntu-toolchain-r-test
68-
packages:
69-
- gcc-5
70-
- gcc-5-multilib
71-
env: OPTS="--quiet --jerry-tests --jerry-test-suite --skip-list=parser-oom.js --buildoptions=--compile-flag=-fsanitize=undefined,--compile-flag=-m32,--compile-flag=-fno-omit-frame-pointer,--compile-flag=-fno-common,--debug,--jerry-libc=off,--static-link=off,--system-allocator=on,--linker-flag=-fuse-ld=gold" UBSAN_OPTIONS=print_stacktrace=1 TIMEOUT=600
113+
72114
- env: JOBNAME="SonarQube"
73115
addons:
74116
sonarcloud:
@@ -87,49 +129,63 @@ matrix:
87129
cache:
88130
directories:
89131
- '${HOME}/.sonar/cache'
132+
90133
- env: JOBNAME="ESP8266 Build Test"
91134
cache: ccache
92-
install: make -f ./targets/esp8266/Makefile.travis install
135+
install: make -f ./targets/esp8266/Makefile.travis install-noapt
93136
script: make -f ./targets/esp8266/Makefile.travis script
137+
addons:
138+
apt:
139+
packages: [gperf, texinfo, wget]
140+
94141
- env: JOBNAME="Mbed/K64F Build Test"
95142
addons:
96143
apt:
97144
sources:
98145
- sourceline: ppa:team-gcc-arm-embedded/ppa
99-
packages:
100-
- gcc-arm-embedded
101-
install: make -f ./targets/mbed/Makefile.travis install
146+
packages: [gcc-arm-embedded, ninja-build, libffi-dev, libssl-dev]
147+
install: make -f ./targets/mbed/Makefile.travis install-noapt
102148
script: make -f ./targets/mbed/Makefile.travis script
149+
103150
- env: JOBNAME="Mbed OS 5/K64F Build Test"
104151
addons:
105152
apt:
106153
sources:
107154
- sourceline: ppa:team-gcc-arm-embedded/ppa
108-
packages:
109-
- gcc-arm-embedded
155+
packages: [gcc-arm-embedded]
110156
install: make -f ./targets/mbedos5/Makefile.travis install
111157
script: make -f ./targets/mbedos5/Makefile.travis script
158+
112159
- env: JOBNAME="NuttX/STM32F4 Build Test"
113-
install: make -f targets/nuttx-stm32f4/Makefile.travis install
160+
install: make -f targets/nuttx-stm32f4/Makefile.travis install-noapt
114161
script: make -f targets/nuttx-stm32f4/Makefile.travis script
162+
addons:
163+
apt:
164+
packages: [gcc-arm-none-eabi, libnewlib-arm-none-eabi, gperf]
165+
115166
- env: JOBNAME="RIOT/STM32F4 Build Test"
116-
install: make -f ./targets/riot-stm32f4/Makefile.travis install
167+
install: make -f ./targets/riot-stm32f4/Makefile.travis install-noapt
117168
script: make -f ./targets/riot-stm32f4/Makefile.travis script
169+
addons:
170+
apt:
171+
packages: [gcc-arm-none-eabi, libnewlib-arm-none-eabi]
172+
118173
- env: JOBNAME="Tizen RT/Artik053 Build Test"
119174
addons:
120175
apt:
121176
sources:
122177
- sourceline: ppa:team-gcc-arm-embedded/ppa
123-
packages:
124-
- gcc-arm-embedded
178+
packages: [gcc-arm-embedded]
125179
install: make -f ./targets/tizenrt-artik053/Makefile.travis install
126180
script: make -f ./targets/tizenrt-artik053/Makefile.travis script
181+
127182
- env: JOBNAME="Zephyr/Arduino 101 Build Test"
128-
install: make -f ./targets/zephyr/Makefile.travis install
183+
install: make -f ./targets/zephyr/Makefile.travis install-noapt
129184
script: make -f ./targets/zephyr/Makefile.travis script
130-
allow_failures:
131-
- env: JOBNAME="Mbed/K64F Build Test"
132-
- env: JOBNAME="Zephyr/Arduino 101 Build Test"
185+
addons:
186+
apt:
187+
packages: [gperf, dfu-util, device-tree-compiler, python3-ply, python3-pip]
188+
133189
fast_finish: true
134190

135191
# The channel name "chat.freenode.net#jerryscript"

targets/esp8266/Makefile.travis

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ install-espressif-sdk:
4141
wget https://github.com/esp8266/esp8266-wiki/raw/master/libs/libhal.a -O ../ESP8266_SDK/lib/libhal.a
4242

4343
# Perform all the necessary (JerryScript-independent) installation steps.
44-
install: install-apt-get-deps install-xtensa-kx106-gcc install-espressif-sdk
44+
install-noapt: install-xtensa-kx106-gcc install-espressif-sdk
45+
install: install-apt-get-deps install-noapt
4546

4647

4748
## Targets for building ESP8266 with JerryScript.

targets/mbed/Makefile.mbed

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ js2c:
7474

7575
yotta:
7676
cd targets/mbed; \
77+
export WCMAKE=`which cmake`; export PATH=`pwd`:$$PATH; \
7778
yotta target $(YOTTA_TARGET); \
7879
yotta build
7980

targets/mbed/Makefile.travis

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ install-apt-get-deps:
2727

2828
# Install yotta
2929
install-yotta:
30-
pyenv global 2.7.13 # force the python version to a newer one
3130
pip install --user "pyOpenSSL<17.5" # fix for failures with pyOpenSSL 17.5
3231
pip install --user yotta
3332

3433
# Perform all the necessary (JerryScript-independent) installation steps.
35-
install: install-apt-get-deps install-yotta
34+
install-noapt: install-yotta
35+
install: install-apt-get-deps install-noapt
3636

3737

3838
## Targets for building Mbed with JerryScript.

targets/mbed/cmake

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/bash
2+
3+
# Copyright JS Foundation and other contributors, http://js.foundation
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+
# http://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+
# HACK:
18+
# Wrapping cmake to ensure that yotta-driven cmake (3.6+) accepts
19+
# arm-none-eabi-gcc as working compiler.
20+
# WCMAKE variable must be set to the full path of the wrapped cmake.
21+
# Related yotta issue: https://github.com/ARMmbed/yotta/issues/783
22+
$WCMAKE -DCMAKE_C_COMPILER_WORKS=TRUE $@

targets/nuttx-stm32f4/Makefile.travis

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ install-clone-nuttx:
4343
git clone https://bitbucket.org/nuttx/nuttx.git ../nuttx -b nuttx-7.22
4444

4545
# Perform all the necessary (JerryScript-independent) installation steps.
46-
install: install-apt-get-deps install-kconfig install-clone-nuttx
46+
install-noapt: install-kconfig install-clone-nuttx
47+
install: install-apt-get-deps install-noapt
4748

4849

4950
## Targets for building NuttX with JerryScript.

targets/riot-stm32f4/Makefile.travis

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ install-clone-riot:
3030
git clone git://github.com/RIOT-OS/RIOT.git ../RIOT -b 2017.10
3131

3232
# Perform all the necessary (JerryScript-independent) installation steps.
33-
install: install-apt-get-deps install-clone-riot
33+
install-noapt: install-clone-riot
34+
install: install-apt-get-deps install-noapt
3435

3536

3637
## Targets for building RIOT with JerryScript.

targets/zephyr/Makefile.travis

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,17 @@ install-apt-get-deps:
2929
install-zephyr-sdk:
3030
wget https://github.com/zephyrproject-rtos/meta-zephyr-sdk/releases/download/0.9.2/zephyr-sdk-0.9.2-setup.run -O ../zephyr-sdk-0.9.2-setup.run
3131
sh ../zephyr-sdk-0.9.2-setup.run -- -y -d $(CURDIR)/../zephyr-sdk-0.9.2
32-
wget https://cmake.org/files/v3.8/cmake-3.8.2-Linux-x86_64.sh
33-
sudo sh cmake-3.8.2-Linux-x86_64.sh --prefix=/usr/local --exclude-subdir
3432
cmake --version
3533

3634
# Fetch Zephyr Project repository and install python dependencies.
37-
install-zephyr: install-apt-get-deps
35+
install-zephyr:
3836
git clone https://github.com/zephyrproject-rtos/zephyr.git ../zephyr -b v1.10.0
37+
pip3 install --user -U setuptools
3938
pip3 install --user -r ../zephyr/scripts/requirements.txt
4039

4140
# Perform all the necessary (JerryScript-independent) installation steps.
42-
install: install-zephyr-sdk install-zephyr
41+
install-noapt: install-zephyr-sdk install-zephyr
42+
install: install-apt-get-deps install-noapt
4343

4444

4545
## Targets for building Zephyr with JerryScript.

0 commit comments

Comments
 (0)