forked from ldc-developers/ldc
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy path.travis.yml
155 lines (145 loc) · 4.5 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
dist: xenial
language: d
git:
depth: 50
matrix:
include:
- os: linux
d: ldc
env: LLVM_VERSION=9.0.0 OPTS="-DBUILD_SHARED_LIBS=ON"
- os: linux
d: ldc-beta
env: LLVM_VERSION=8.0.0 OPTS="-DBUILD_SHARED_LIBS=OFF"
# FIXME: strange crashes, possibly due to C++ compiler mismatch
#- os: linux
# d: ldc
# env: LLVM_VERSION=7.0.1 OPTS="-DBUILD_SHARED_LIBS=ON"
- os: linux
d: ldc-beta
env: LLVM_VERSION=6.0.1 OPTS="-DBUILD_SHARED_LIBS=OFF -DLIB_SUFFIX=64 -DRT_SUPPORT_SANITIZERS=ON"
- os: linux
d: ldc
env: LLVM_VERSION=5.0.2 OPTS="-DBUILD_SHARED_LIBS=ON -DLIB_SUFFIX=64"
- os: linux
d: ldc-0.17.6
env: LLVM_VERSION=4.0.0 OPTS="-DLIB_SUFFIX=64"
- os: linux
d: dmd
env: LLVM_VERSION=3.9.1
- os: osx
osx_image: xcode9.2
d: dmd
env: LLVM_VERSION=8.0.0 OPTS="-DBUILD_SHARED_LIBS=ON"
- os: osx
osx_image: xcode9.2
d: ldc-beta
env: LLVM_VERSION=7.0.0 OPTS="-DBUILD_SHARED_LIBS=OFF"
cache:
directories:
- llvm-9.0.0
- llvm-8.0.0
- llvm-7.0.1
- llvm-7.0.0
- llvm-6.0.1
- llvm-5.0.2
- llvm-4.0.0
- llvm-3.9.1
- clang-calypso
addons:
apt:
packages:
- gdb
- ninja-build
# Download & extract prebuilt vanilla LLVM if not in cache
before_install:
- export LLVM_ROOT_DIR="$PWD/llvm-$LLVM_VERSION"
- |
if [ ! -e "$LLVM_ROOT_DIR/bin/llvm-config" ]; then
if [ "$TRAVIS_OS_NAME" = "linux" ]; then
export LLVM_ARCH="x86_64-linux-gnu-ubuntu-16.04"
else
export LLVM_ARCH="x86_64-apple-darwin"
fi
wget -O llvm.tar.xz http://releases.llvm.org/$LLVM_VERSION/clang+llvm-$LLVM_VERSION-$LLVM_ARCH.tar.xz
mkdir -p $LLVM_ROOT_DIR
tar -xf llvm.tar.xz --strip 1 -C $LLVM_ROOT_DIR
rm llvm.tar.xz
fi
-
if [ "${TRAVIS_OS_NAME}" = "linux" ]; then
wget -O clang-calypso.tar.xz https://github.com/Syniurge/clang/releases/download/v5.0/clang-5.0-calypso.tar.xz;
elif [ "${TRAVIS_OS_NAME}" = "osx" ]; then
wget -O clang-calypso.tar.xz https://github.com/Syniurge/clang/releases/download/v5.0/clang-5.0-calypso-osx.tar.xz;
fi;
mkdir clang-calypso;
tar -xvf clang-calypso.tar.xz --strip 1 -C clang-calypso;
export CLANG_PREBUILT="$(pwd)/clang-calypso";
install:
- |
if [ "$TRAVIS_OS_NAME" = "osx" ]; then
# Install pip
wget -O get-pip.py https://bootstrap.pypa.io/get-pip.py
sudo python get-pip.py
rm get-pip.py
# Download & extract Ninja & add to PATH
wget -O ninja-mac.zip https://github.com/ninja-build/ninja/releases/download/v1.9.0/ninja-mac.zip
mkdir ninja
tar -xf ninja-mac.zip -C ninja
rm ninja-mac.zip
export PATH="$PWD/ninja:$PATH"
fi
# Install lit
- pip install --user lit
- python -c "import lit; lit.main();" --version | head -n 1
before_script:
- mkdir build
- cd build
script:
- unset LD_LIBRARY_PATH
- cmake --version
- ninja --version
- |
cmake -G Ninja . \
-DCMAKE_BUILD_TYPE=Release \
-DLLVM_ROOT_DIR=$LLVM_ROOT_DIR \
-DLDC_INSTALL_LTOPLUGIN=ON \
-DLDC_INSTALL_LLVM_RUNTIME_LIBS=ON \
-DCLANG_BUILD_FLAGS="-j2" \
-DCLANG_PREBUILT_DIR="${CLANG_PREBUILT}" \
$OPTS
# Build LDC & LDC D unittests & defaultlib unittest runners
- |
numJobs=3
# The OSX VM has only 4 GB of memory (Linux: 7.5)
if [ "$TRAVIS_OS_NAME" = "osx" ]; then
numJobs=2
fi
ninja -j$numJobs all ldc2-unittest all-test-runners
- bin/ldc2 -version || exit 1
# Run LDC D unittests
- ctest --output-on-failure -R "ldc2-unittest"
# Run LIT testsuite
- ctest -V -R "lit-tests"
# Run DMD testsuite (release only, i.e., no dmd-testsuite-debug, to reduce time-outs)
- |
# The -lowmem tests don't work with an ltsmaster host compiler
if [[ "$($DC --version | head -n 1)" == *0.17.* ]]; then
rm tests/d2/dmd-testsuite/runnable/{testptrref,xtest46}_gc.d
rm tests/d2/dmd-testsuite/fail_compilation/mixin_gc.d
fi
DMD_TESTSUITE_MAKE_ARGS=-j3 ctest -V -R "dmd-testsuite" -E "-debug$"
# Run defaultlib unittests & druntime stand-alone tests
- ctest -j3 --output-on-failure -E "dmd-testsuite|lit-tests|ldc2-unittest"
after_success:
- |
if [[ "$OPTS" == *-DTEST_COVERAGE?ON* ]]; then
coveralls -e runtime -e tests -e vcbuild --gcov gcov-4.9 --gcov-options '\-lp' > /dev/null 2>&1
fi
notifications:
email:
recipients:
on_success: never
on_failure: change
use_notice: false
skip_join: true