forked from WebAssembly/binaryen
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
165 lines (151 loc) · 6.26 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
sudo: false
dist: trusty
language: cpp
jobs:
include:
# Build with clang and run tests on the host system (Ubuntu).
- &test-ubuntu
stage: test
compiler: clang
python: 2.7
node_js: 7
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['cmake', 'g++-5']
before_install:
- export CC="${CC_COMPILER}"
- export CXX="${CXX_COMPILER}"
- export ASAN_OPTIONS="symbolize=1"
install:
- pip install --user flake8==3.4.1
before_script:
# Check the style of a subset of Python code until the other code is updated.
- flake8 ./scripts/
- ./check.py --test-waterfall --only-prepare
script:
- cmake . -DCMAKE_C_FLAGS="$COMPILER_FLAGS" -DCMAKE_CXX_FLAGS="$COMPILER_FLAGS"
- make -j2
- ./check.py --test-waterfall
env: |
CC_COMPILER="./test/wasm-install/wasm-install/bin/clang"
CXX_COMPILER="./test/wasm-install/wasm-install/bin/clang++"
- <<: *test-ubuntu
env: |
CC_COMPILER="./test/wasm-install/wasm-install/bin/clang"
CXX_COMPILER="./test/wasm-install/wasm-install/bin/clang++"
COMPILER_FLAGS="-fsanitize=undefined -fno-sanitize-recover=all -fsanitize-blacklist=$(pwd)/ubsan.blacklist"
- <<: *test-ubuntu
env: |
CC_COMPILER="./test/wasm-install/wasm-install/bin/clang"
CXX_COMPILER="./test/wasm-install/wasm-install/bin/clang++"
COMPILER_FLAGS="-fsanitize=address"
- <<: *test-ubuntu
env: |
CC_COMPILER="./test/wasm-install/wasm-install/bin/clang"
CXX_COMPILER="./test/wasm-install/wasm-install/bin/clang++"
COMPILER_FLAGS="-fsanitize=thread"
# Build with gcc 5 and run tests on the host system (Ubuntu).
- <<: *test-ubuntu
compiler: gcc
env: |
CC_COMPILER="gcc-5"
CXX_COMPILER="g++-5"
# Build the .js outputs using emcc
- &test-emcc
stage: test
compiler: clang
python: 2.7
node_js: 7
language: node_js
node_js:
- node
sudo: required
services:
- docker
before_install:
- docker run -dit --name emscripten -v $(pwd):/src trzeci/emscripten:sdk-incoming-64bit bash
script:
# run binaryen.js and wasm.js tests before and after building, so we see if the bundled
# version is good too
- docker exec -it emscripten bash ./travis-emcc-tests.sh
# Build with gcc 6.3 and run tests on Alpine Linux (inside chroot).
# Note: Alpine uses musl libc.
- &test-alpine
stage: test
sudo: true
language: minimal
compiler: gcc
env: ARCH=x86_64
before_install:
- &download-alpine-script
"wget 'https://raw.githubusercontent.com/alpinelinux/alpine-chroot-install/v0.6.0/alpine-chroot-install' \
&& echo 'a827a4ba3d0817e7c88bae17fe34e50204983d1e alpine-chroot-install' | sha1sum -c || travis_terminate 1"
- &define-alpine-func
alpine() { /alpine/enter-chroot -u "$USER" "$@"; }
install:
- sudo sh alpine-chroot-install -a "$ARCH" -p 'build-base cmake git nodejs python2'
before_script:
- alpine ./check.py --test-waterfall --only-prepare
script:
- alpine cmake .
- alpine make -j2
- alpine ./check.py --test-waterfall
# Build statically linked release binaries with gcc 6.3 on Alpine Linux
# (inside chroot). If building a tagged commit, then deploy release tarball
# to GitHub Releases.
- &build-alpine
<<: *test-alpine
stage: build
env: ARCH=x86_64
before_install:
# XXX: This is ugly hack to skip this job (and all derived) for pull
# requests, run it only on master branch and tags (to cut down build
# time). Replace it after Travis finally implement proper support for
# conditional jobs or stages.
- if [[ "$TRAVIS_PULL_REQUEST" != "false" || ( "$TRAVIS_BRANCH" != "master" && -z "$TRAVIS_TAG" ) ]]; then
travis_terminate 0;
fi
- *download-alpine-script
- *define-alpine-func
# Don't run before_script inherited from *test-alpine.
before_script: skip
script:
- alpine cmake -DCMAKE_BUILD_TYPE=Release
-DCMAKE_VERBOSE_MAKEFILE=ON
-DCMAKE_CXX_FLAGS="-static -no-pie"
-DCMAKE_C_FLAGS="-static -no-pie" .
- alpine make -j2
- alpine find bin/ -type f -perm -u=x -exec strip {} +
- alpine ls -lh bin/
# Check if the built executables are really statically linked.
- if [ -n "$(find bin/ -type f -perm -u=x -exec file {} + | grep -Fvw 'statically linked')" ]; then
file bin/*; false;
fi
before_deploy:
- PKGNAME="binaryen-$TRAVIS_TAG-$ARCH-linux"
- mv bin binaryen-$TRAVIS_TAG
- tar -czf $PKGNAME.tar.gz binaryen-$TRAVIS_TAG
- sha256sum $PKGNAME.tar.gz > $PKGNAME.tar.gz.sha256
deploy:
provider: releases
api_key:
secure: "cu6CD5BaycXdCylvcs+Fho5+OVTkh9mZwH8RTnNpXo9hAQzLJDFgcNBHeXHEHtcp4IWf/YZSMu48UKnpU9sP5iF0AS4rtuEBJk5gOKkgB8GWnuIOePFkfANAZMN+EncuUwhAdN56iOAESXqnlHYgmJjyRVCHOxiezuWTOYui4lxoIAdxvOMJc3E9yfzUq4Epm2GDszSDN7ObmRIJpVgDXD9Sze1Xv4IkbIwc0biCmduGGLp3ow2KM+RZ4tOF0c8P0ki49vOFHr6n2Vmqg0QCiVNd4JJBRBCGn6Tzip2jsTQewnUUvpYCZafLeRV//v//voNA6ZUz91yXR23GIhkfdlyuqnz3/7l335Sa749M1lpYfSRWvwg9mJEqP66mxqTrWzj1xSItr9T+p0WhSmRN/4UEJPuItYPSma6kfv+H7qhLa3ZYKECH8hHW79grYmUWtiX0vQVIgnctJGgboPNLfG/1mNtmCI241wK0S3zvL2okdZH8/PqxfllYHMBTUp9lUrop8eoLKPgHZPm6+V20dgTUgOuGTZzTWwQ7Uk/Pg8JMUgkre5y0eo6pP3z0vDW1NNFNhouJ5oGkAeK/HAznr8Q0zWWF1vGFhoyC8ok/IJ7yKxK9scJVPBDe4oox6tr1zlsxzNEYE0/mY3JjuWV0z8RgjrIAbRe8IpGTkYz5VOM="
file: binaryen-$TRAVIS_TAG-*.tar.gz*
file_glob: true
skip_cleanup: true
on:
tags: true
# Build binaries for other architectures using QEMU user-mode emulation.
# Note: We don't run tests for these architectures, because some fail under
# QEMU/binfmt and it takes too long time (hits time limit on Travis).
- <<: *build-alpine
env: ARCH=x86
- <<: *build-alpine
env: ARCH=aarch64
- <<: *build-alpine
env: ARCH=armhf
- <<: *build-alpine
env: ARCH=ppc64le
notifications:
email: false