Skip to content

Commit 234ff04

Browse files
authored
ci: upgrade distro to xenial and add arm64 test cases (Tencent#1662)
Start from xenial, Travis supports multiple CPU architectures. To bump to this version allows expand test coverage for more architectures. See: https://docs.travis-ci.com/user/reference/overview/#virtualisation-environment-vs-operating-system Add arm64 test cases to matrix. Change-Id: If61e2d38223dad70b542d6ec0afcf4a433c9debf Signed-off-by: Jun He <[email protected]> Co-authored-by: Jun He <[email protected]>
1 parent 36481c3 commit 234ff04

File tree

1 file changed

+60
-13
lines changed

1 file changed

+60
-13
lines changed

.travis.yml

Lines changed: 60 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
11
sudo: required
2-
dist: trusty
3-
group: edge
2+
dist: xenial
43

54
language: cpp
65
cache:
76
- ccache
87

8+
addons:
9+
apt:
10+
sources:
11+
- ubuntu-toolchain-r-test
12+
packages:
13+
- cmake
14+
- valgrind
15+
- clang-8
916
env:
1017
global:
1118
- USE_CCACHE=1
@@ -14,41 +21,60 @@ env:
1421
- CCACHE_MAXSIZE=100M
1522
- ARCH_FLAGS_x86='-m32' # #266: don't use SSE on 32-bit
1623
- ARCH_FLAGS_x86_64='-msse4.2' # use SSE4.2 on 64-bit
24+
- ARCH_FLAGS_aarch64='-march=armv8-a'
1725
- GITHUB_REPO='Tencent/rapidjson'
1826
- secure: "HrsaCb+N66EG1HR+LWH1u51SjaJyRwJEDzqJGYMB7LJ/bfqb9mWKF1fLvZGk46W5t7TVaXRDD5KHFx9DPWvKn4gRUVkwTHEy262ah5ORh8M6n/6VVVajeV/AYt2C0sswdkDBDO4Xq+xy5gdw3G8s1A4Inbm73pUh+6vx+7ltBbk="
1927

20-
before_install:
21-
- sudo apt-add-repository -y ppa:ubuntu-toolchain-r/test
22-
- sudo apt-get update -qq
23-
- sudo apt-get install -y cmake valgrind g++-multilib libc6-dbg:i386 --allow-unauthenticated
24-
2528
matrix:
2629
include:
2730
# gcc
2831
- env: CONF=release ARCH=x86 CXX11=ON
2932
compiler: gcc
33+
arch: amd64
3034
- env: CONF=release ARCH=x86_64 CXX11=ON
3135
compiler: gcc
36+
arch: amd64
3237
- env: CONF=debug ARCH=x86 CXX11=OFF
3338
compiler: gcc
39+
arch: amd64
3440
- env: CONF=debug ARCH=x86_64 CXX11=OFF
3541
compiler: gcc
42+
arch: amd64
43+
- env: CONF=release ARCH=aarch64 CXX11=ON
44+
compiler: gcc
45+
arch: arm64
46+
- env: CONF=debug ARCH=aarch64 CXX11=OFF
47+
compiler: gcc
48+
arch: arm64
3649
# clang
3750
- env: CONF=debug ARCH=x86 CXX11=ON CCACHE_CPP2=yes
3851
compiler: clang
52+
arch: amd64
3953
- env: CONF=debug ARCH=x86_64 CXX11=ON CCACHE_CPP2=yes
4054
compiler: clang
55+
arch: amd64
4156
- env: CONF=debug ARCH=x86 CXX11=OFF CCACHE_CPP2=yes
4257
compiler: clang
58+
arch: amd64
4359
- env: CONF=debug ARCH=x86_64 CXX11=OFF CCACHE_CPP2=yes
4460
compiler: clang
61+
arch: amd64
4562
- env: CONF=release ARCH=x86 CXX11=ON CCACHE_CPP2=yes
4663
compiler: clang
64+
arch: amd64
4765
- env: CONF=release ARCH=x86_64 CXX11=ON CCACHE_CPP2=yes
4866
compiler: clang
67+
arch: amd64
68+
- env: CONF=debug ARCH=aarch64 CXX11=ON CCACHE_CPP2=yes
69+
compiler: clang
70+
arch: arm64
71+
- env: CONF=debug ARCH=aarch64 CXX11=OFF CCACHE_CPP2=yes
72+
compiler: clang
73+
arch: arm64
4974
# coverage report
5075
- env: CONF=debug ARCH=x86 CXX11=ON GCOV_FLAGS='--coverage'
5176
compiler: gcc
77+
arch: amd64
5278
cache:
5379
- ccache
5480
- pip
@@ -57,6 +83,16 @@ matrix:
5783
- coveralls -r .. --gcov-options '\-lp' -e thirdparty -e example -e test -e build/CMakeFiles -e include/rapidjson/msinttypes -e include/rapidjson/internal/meta.h -e include/rapidjson/error/en.h
5884
- env: CONF=debug ARCH=x86_64 GCOV_FLAGS='--coverage'
5985
compiler: gcc
86+
arch: amd64
87+
cache:
88+
- ccache
89+
- pip
90+
after_success:
91+
- pip install --user cpp-coveralls
92+
- coveralls -r .. --gcov-options '\-lp' -e thirdparty -e example -e test -e build/CMakeFiles -e include/rapidjson/msinttypes -e include/rapidjson/internal/meta.h -e include/rapidjson/error/en.h
93+
- env: CONF=debug ARCH=aarch64 GCOV_FLAGS='--coverage'
94+
compiler: gcc
95+
arch: arm64
6096
cache:
6197
- ccache
6298
- pip
@@ -73,13 +109,24 @@ matrix:
73109
packages:
74110
- doxygen
75111

112+
before_install:
113+
- if [ "x86_64" = "$(arch)" ]; then sudo apt-get install -y g++-multilib libc6-dbg:i386 --allow-unauthenticated; fi
114+
76115
before_script:
77-
- ccache -s
78-
# hack to avoid Valgrind bug (https://bugs.kde.org/show_bug.cgi?id=326469),
79-
# exposed by merging PR#163 (using -march=native)
80-
# TODO: Since this bug is already fixed. Remove this when valgrind can be upgraded.
81-
- sed -i "s/-march=native//" CMakeLists.txt
82-
- mkdir build
116+
# travis provides clang-7 for amd64 and clang-3.8 for arm64
117+
# here use clang-8 to all architectures as clang-7 is not available for arm64
118+
- if [ -f /usr/bin/clang++-8 ]; then
119+
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-8 1000;
120+
sudo update-alternatives --config clang++;
121+
export PATH=/usr/bin:$PATH;
122+
fi
123+
- if [ "$CXX" = "clang++" ]; then export CCACHE_CPP2=yes; fi
124+
- ccache -s
125+
# hack to avoid Valgrind bug (https://bugs.kde.org/show_bug.cgi?id=326469),
126+
# exposed by merging PR#163 (using -march=native)
127+
# TODO: Since this bug is already fixed. Remove this when valgrind can be upgraded.
128+
- sed -i "s/-march=native//" CMakeLists.txt
129+
- mkdir build
83130

84131
script:
85132
- if [ "$CXX" = "clang++" ]; then export CXXFLAGS="-stdlib=libc++ ${CXXFLAGS}"; fi

0 commit comments

Comments
 (0)