This repository has been archived by the owner on Jul 19, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
/
.travis.yml
121 lines (115 loc) · 3.82 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
language: node_js
node_js:
- 14.15.4
sudo: false
# enable c++11/14 builds
addons:
apt:
sources: [ 'ubuntu-toolchain-r-test' ]
packages: [ 'libstdc++-4.9-dev' ]
install:
# set up the environment by installing mason and clang++
- ./scripts/setup.sh --config local.env
# put mason and clang++ on PATH
- source local.env
- node -v
- which node
- clang++ -v
- which clang++
- npm ci --ignore-scripts
- make ${BUILDTYPE}
# run tests
# We use before_script rather than script to ensure fast failure (the script section continues even after an error)
# https://docs.travis-ci.com/user/customizing-the-build#Breaking-the-Build
before_script:
- npm test
- make test-${BUILDTYPE}
# after successful tests, publish binaries if specified in commit message
- ./scripts/publish.sh --toolset=${TOOLSET:-} --debug=$([ "${BUILDTYPE}" == 'debug' ] && echo "true" || echo "false")
# override script default (npm test) to do nothing (we test in before_script)
script:
- true
# the matrix allows you to specify different operating systems and environments to
# run your tests and build binaries
matrix:
include:
# linux publishable node v14
- os: linux
env: BUILDTYPE=release
# linux publishable node v14/debug
- os: linux
env: BUILDTYPE=debug
# linux publishable node v12
- os: linux
env: BUILDTYPE=release
node_js: 12
# linux publishable node v12/debug
- os: linux
env: BUILDTYPE=debug
node_js: 12
# linux publishable node v10
- os: linux
env: BUILDTYPE=release
node_js: 10
# linux publishable node v10/debug
- os: linux
env: BUILDTYPE=debug
node_js: 10
# osx publishable node v14
- os: osx
osx_image: xcode12
env: BUILDTYPE=release
# Sanitizer build node v4/Debug
- os: linux
env: BUILDTYPE=debug TOOLSET=asan
# Overrides `install` to set up custom asan flags
install:
- ./scripts/setup.sh --config local.env
# put mason and clang++ on PATH
- source local.env
# Note: to build without stopping on errors remove the -fno-sanitize-recover=all flag
# You might want to do this if there are multiple errors and you want to see them all before fixing
- export CXXFLAGS="${MASON_SANITIZE_CXXFLAGS} -fno-sanitize-recover=all"
- export LDFLAGS="${MASON_SANITIZE_LDFLAGS}"
- npm ci --ignore-scripts
- make ${BUILDTYPE}
# Overrides `script` to disable asan LD_PRELOAD before publishing
before_script:
- export LD_PRELOAD=${MASON_LLVM_RT_PRELOAD}
- export ASAN_OPTIONS=fast_unwind_on_malloc=0:${ASAN_OPTIONS}
- export LSAN_OPTIONS=suppressions=asan-suppress.txt
- npm test
- unset LD_PRELOAD
# g++ build (default builds all use clang++)
- os: linux
env: BUILDTYPE=debug CXX="g++-6" CC="gcc-6"
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- libstdc++-6-dev
- g++-6
# Overrides `install` to avoid initializing clang toolchain
install:
- npm ci --ignore-scripts
- make ${BUILDTYPE}
- make test-${BUILDTYPE}
# Overrides `script` to disable publishing
before_script:
- npm test
- make test-${BUILDTYPE}
# Coverage build
#- os: linux
# env: BUILDTYPE=debug CXXFLAGS="--coverage" LDFLAGS="--coverage"
# # Overrides `script` to publish coverage data to codecov
# before_script:
# - ./scripts/format.sh
# - make test-${BUILDTYPE}
# - npm run coverage
# - mason install llvm-cov ${MASON_LLVM_RELEASE}
# - mason link llvm-cov ${MASON_LLVM_RELEASE}
# - which llvm-cov
# - curl -S -f https://codecov.io/bash -o codecov
# - chmod +x codecov
# - ./codecov -x "llvm-cov gcov" -Z