-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
68 lines (57 loc) · 2.6 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
# travis auto test config file
# you can edit it as you like but make sure it can run in remote system
language: cpp
matrix:
include:
- os: linux
addons:
apt:
sources:
- kubuntu-backports # for cmake
- ubuntu-toolchain-r-test # for g++-7 (maybe)
- llvm-toolchain-trusty-5.0 # for clang-5.0 (maybe)
packages:
- cmake # for cmake
# (why this version? later we will talk about it)
- g++-7 # for this version g++
- clang-5.0 # for this version clang
- python3 # for python3 (pip3 need)
- python3-pip # for pip (conan need)
# - os: osx
# osx_image: xcode8.3
# execute all of the commands which need to be executed
# before installing dependencies
before_install:
# mac os install
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew upgrade python; fi
# set this will avoid linux memory not enough problem
- if [[ "$TRAVIS_OS_NAME" == "linux" && "$CXX" == "g++" ]]; then export CXX="g++-7" CC="gcc-7"; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" && "$CXX" == "clang++" ]]; then export CXX="clang++-5.0" CC="clang-5.0"; fi
# install all of the dependencies you need here
# Install conan
install:
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then pip3 install --user conan; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then pip3 install conan; fi
# execute all of the commands which need to be executed
# before running actual tests
before_script:
script:
# execute all of the commands which should make the build pass or fail
- mkdir build && cd build
# add some remote (I don't know if this is necessary, but I add it anyway)
- conan remote add bincrafters https://api.bintray.com/conan/bincrafters/public-conan
# why compiler.libcxx=libstdc++11 ?
# for gtest, without this you will face error in the final make
# why --build=missing
# for conan can't download pre build libs, you need build it by yourself
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then conan install .. -s compiler.libcxx=libstdc++11 --build=gtest; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then conan install .. -s compiler=apple-clang -s compiler.version=8.1 --build=missing; fi
- cmake ..
- make -j8
# run test
- cd bin
- ./parser-test && ./lexer-test && ./scope-test && ./type-check-test && ./code-gen-test && ./pipeline-test
after_success:
# so, pass the test...
- echo '( ̄▽ ̄)~*' cheers!