11sudo : false
22dist : bionic
33language : cpp
4+ python :
5+ - 3.6
46
57stages :
68 - name : test
7- - name : build
8- # Don't run build stage for pull requests and other branches than master
9+ - name : archive
10+ # Don't run archive stage for pull requests and other branches than master
911 # to save time and resources.
1012 if : type != pull_request AND (branch = master OR tag IS present)
1113
@@ -27,78 +29,82 @@ DEPLOY_TO_GITHUB: &DEPLOY_TO_GITHUB
2729
2830jobs :
2931 include :
30- # OSX Binary
31- - env : JOB=dist-osx ARCH=x86_64-apple-darwin
32- os : osx
33- stage : build
32+ - name : lint-checks
33+ stage : test
34+ addons :
35+ apt :
36+ packages : ['python3-pip']
37+ install : pip3 install --user flake8==3.7.8
3438 script :
35- - cmake . && make
36- << : *DEPLOY_TO_GITHUB
39+ - flake8
40+ - ./clang-tidy-diff.sh
41+ - ./clang-format-diff.sh
42+ # ensure generated parser is up to date
43+ - ./scripts/gen-s-parser.py | diff src/gen-s-parser.inc -
3744
3845 # Build with clang and run tests on the host system (Ubuntu).
3946 - &test-ubuntu
47+ name : clang
4048 stage : test
4149 compiler : clang
42- python :
43- - 2.7
44- - 3.6
4550 addons :
4651 apt :
4752 sources : ['ubuntu-toolchain-r-test']
48- packages : ['cmake', 'g++-5', 'python3-pip' ]
53+ packages : ['cmake', 'g++-5']
4954 before_install :
5055 - export ASAN_OPTIONS="$ASAN_OPTIONS symbolize=1"
5156 install :
5257 - nvm install 12
5358 - nvm use 12
54- - pip3 install --user flake8==3.7.8
5559 # get jsvu in order to get more js engines
5660 - npm install jsvu -g
5761 - export PATH="${HOME}/.jsvu:${PATH}"
5862 - jsvu --os=linux64 --engines=spidermonkey,v8
5963 script :
6064 - set -o errexit
61- - flake8
62- - ./clang-format-diff.sh
63- # ensure generated parser is up to date
64- - ./scripts/gen-s-parser.py | diff src/gen-s-parser.inc -
65- - BUILD_SUBDIR=${BUILD_SUBDIR:-.}
66- - mkdir -p ${BUILD_SUBDIR} && cd ${BUILD_SUBDIR}
67- - cmake ${TRAVIS_BUILD_DIR} -DCMAKE_C_FLAGS="$COMPILER_FLAGS" -DCMAKE_CXX_FLAGS="$COMPILER_FLAGS" -DCMAKE_EXE_LINKER_FLAGS="$LINKER_FLAGS" -DCMAKE_INSTALL_PREFIX=install -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
68- # clang-tidy-diff.sh may not exist when BUILD_SUBDIR is a subdirectory
69- - if [ -f clang-tidy-diff.sh ]; then ./clang-tidy-diff.sh; fi
65+ - BUILD_DIR=${BUILD_DIR:-.}
66+ - mkdir -p ${BUILD_DIR} && cd ${BUILD_DIR}
67+ - cmake ${TRAVIS_BUILD_DIR}
68+ -DCMAKE_C_FLAGS="$COMPILER_FLAGS"
69+ -DCMAKE_CXX_FLAGS="$COMPILER_FLAGS"
70+ -DCMAKE_EXE_LINKER_FLAGS="$LINKER_FLAGS"
71+ -DCMAKE_INSTALL_PREFIX=install
72+ -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
7073 - make -j2 install
74+ # Run tests from source directory
7175 - cd ${TRAVIS_BUILD_DIR}
72- - python3 ./check.py --binaryen-bin=${BUILD_SUBDIR}/install/bin
73-
74- - << : *test-ubuntu
75- env : |
76- BUILD_SUBDIR=out
76+ - python3 ./check.py --binaryen-bin=${BUILD_DIR}/install/bin
7777
7878 - << : *test-ubuntu
79+ name : ubsan
7980 env : |
8081 COMPILER_FLAGS="-fsanitize=undefined -fno-sanitize-recover=all -fsanitize-blacklist=$(pwd)/ubsan.blacklist"
8182
8283 # FIXME we currently must disable LSAN entirely, see #1351
8384 - << : *test-ubuntu
85+ name : asan
8486 env : |
8587 COMPILER_FLAGS="-fsanitize=address"
8688 ASAN_OPTIONS="detect_leaks=0"
8789
8890 - << : *test-ubuntu
91+ name : tsan
8992 env : |
9093 COMPILER_FLAGS="-fsanitize=thread"
9194 LINKER_FLAGS="-fsanitize=thread"
9295
9396 # Build with gcc 7 and run tests on the host system (Ubuntu).
97+ # Also tests that out-of-tree builds work
9498 - << : *test-ubuntu
99+ name : gcc-7 / out-of-tree
95100 compiler : gcc
96101 env : |
97102 CC="gcc-7"
98103 CXX="g++-7"
104+ BUILD_DIR=out
99105
100106 # Build the .js outputs using emcc
101- - &test-emcc
107+ - name : emscripten
102108 stage : test
103109 compiler : clang
104110 python : 2.7
@@ -117,6 +123,7 @@ jobs:
117123 # Build with gcc 6.3 and run tests on Alpine Linux (inside chroot).
118124 # Note: Alpine uses musl libc.
119125 - &test-alpine
126+ name : alpine
120127 stage : test
121128 sudo : true
122129 language : minimal
@@ -133,15 +140,22 @@ jobs:
133140 - alpine make -j2
134141 - alpine python3 ./check.py
135142
143+ - name : osx
144+ env : JOB=dist-osx ARCH=x86_64-apple-darwin
145+ os : osx
146+ stage : archive
147+ script :
148+ - cmake . && make
149+ << : *DEPLOY_TO_GITHUB
150+
136151 # Build statically linked release binaries with gcc 6.3 on Alpine Linux
137152 # (inside chroot). If building a tagged commit, then deploy release tarball
138153 # to GitHub Releases.
139- - &build -alpine
154+ - &archive -alpine
140155 << : *test-alpine
141- stage : build
156+ name : x86_64-linux
157+ stage : archive
142158 env : ARCH=x86_64-linux
143- # Don't run before_script inherited from *test-alpine.
144- before_script : skip
145159 script :
146160 - alpine cmake -DCMAKE_BUILD_TYPE=Release
147161 -DCMAKE_VERBOSE_MAKEFILE=ON
@@ -163,13 +177,16 @@ jobs:
163177 # QEMU/binfmt and it takes too long time (hits time limit on Travis).
164178 # Note: We had to remove ppc64le, because it takes more than 50 minutes
165179 # (Travis limit) to build. :(
166- - << : *build-alpine
180+ - << : *archive-alpine
181+ name : x86-linux
167182 env : ARCH=x86-linux
168183
169- - << : *build-alpine
184+ - << : *archive-alpine
185+ name : aarch64-linux
170186 env : ARCH=aarch64-linux
171187
172- - << : *build-alpine
188+ - << : *archive-alpine
189+ name : armhf-linux
173190 env : ARCH=armhf-linux
174191
175192notifications :
0 commit comments