Reduce number of travis builds.
[cvc5.git] / .travis.yml
1 language: cpp
2 cache:
3 - apt
4 - ccache
5
6 # We need more than 4G memory for compiling CVC4. Hence, we cannot switch
7 # to container-based virtualization environments since they only provide 4G of
8 # memory. We will stick with the VM-based environments for now.
9 sudo: required
10 dist: trusty
11
12 compiler:
13 - gcc
14 - clang
15 env:
16 global:
17 # The next declaration is the encrypted COVERITY_SCAN_TOKEN, created
18 # via the "travis encrypt" command using the project repo's public key
19 - secure: "fRfdzYwV10VeW5tVSvy5qpR8ZlkXepR7XWzCulzlHs9SRI2YY20BpzWRjyMBiGu2t7IeJKT7qdjq/CJOQEM8WS76ON7QJ1iymKaRDewDs3OhyPJ71fsFKEGgLky9blk7I9qZh23hnRVECj1oJAVry9IK04bc2zyIEjUYpjRkUAQ="
20 - TEST_GROUPS=2
21 - CCACHE_COMPRESS=1
22 matrix:
23 - TRAVIS_CVC4=yes TRAVIS_CVC4_CHECK_PORTFOLIO=yes TRAVIS_WITH_LFSC=yes TRAVIS_CVC4_CONFIG='production --enable-language-bindings=java,c --with-lfsc --with-portfolio'
24 - TRAVIS_CVC4=yes TRAVIS_WITH_LFSC=yes TRAVIS_CVC4_CONFIG='debug --with-lfsc --disable-debug-symbols'
25 - TRAVIS_CVC4=yes TRAVIS_WITH_LFSC=yes TRAVIS_CVC4_CONFIG='debug --with-cln --enable-gpl --disable-debug-symbols --disable-proof'
26 - TRAVIS_CVC4=yes TRAVIS_CVC4_DISTCHECK=yes TRAVIS_CVC4_CONFIG='--enable-proof'
27 addons:
28 apt:
29 sources:
30 - ubuntu-toolchain-r-test
31 packages: &common_deps
32 - libgmp-dev
33 - libboost-dev
34 - libboost-thread-dev
35 - swig
36 - libcln-dev
37 - openjdk-7-jdk
38 - antlr3
39 - libantlr3c-dev
40 - ant-optional
41 - cxxtest
42 - libreadline-dev
43 before_install:
44 - eval "${MATRIX_EVAL}"
45 # Clang does not play nice with ccache (at least the versions offered by
46 # Travis), use a workaround:
47 # https://github.com/travis-ci/travis-ci/issues/5383#issuecomment-224630584
48 - |
49 if [ "$TRAVIS_OS_NAME" == "linux" ] && [ "$CXX" == "clang++" ]; then
50 export CFLAGS="-Qunused-arguments"
51 export CXXFLAGS="-Qunused-arguments"
52 sudo ln -s $(which ccache) /usr/lib/ccache/clang
53 sudo ln -s $(which ccache) /usr/lib/ccache/clang++
54 fi
55 before_script:
56 - export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64
57 - export PATH=$PATH:$JAVA_HOME/bin
58 - export JAVA_CPPFLAGS=-I$JAVA_HOME/include
59 - ./autogen.sh
60 script:
61 - ccache -M 1G
62 - ccache -z
63 - ${CC} --version
64 - ${CXX} --version
65 - |
66 echo "travis_fold:start:load_script"
67 normal="$(echo -e '\033[0m')" red="$normal$(echo -e '\033[01;31m')" green="$normal$(echo -e '\033[01;32m')"
68 configureCVC4() {
69 echo "CVC4 config - $TRAVIS_CVC4_CONFIG";
70 ./configure --enable-unit-testing $TRAVIS_CVC4_CONFIG ||
71 (echo; echo "Trying to print config.log"; cat builds/config.log; error "CONFIGURE FAILED");
72 }
73 error() {
74 echo;
75 echo "${red}${1}${normal}";
76 echo;
77 exit 1;
78 }
79 makeDistcheck() {
80 make V=1 -j2 distcheck CVC4_REGRESSION_ARGS='--no-early-exit' ||
81 error "DISTCHECK (WITH NEWTHEORY TESTS) FAILED";
82 }
83 makeCheck() {
84 make V=1 -j2 check CVC4_REGRESSION_ARGS='--no-early-exit' || error "BUILD/TEST FAILED";
85 }
86 makeCheckPortfolio() {
87 make V=1 -j2 check BINARY=pcvc4 CVC4_REGRESSION_ARGS='--fallback-sequential --no-early-exit' RUN_REGRESSION_ARGS= ||
88 error "PORTFOLIO TEST FAILED";
89 }
90 makeExamples() {
91 make V=1 -j2 examples || error "COULD NOT BUILD EXAMPLES${normal}";
92 }
93 addNewTheoryTest() {
94 contrib/new-theory test_newtheory || error "NEWTHEORY FAILED";
95 grep -q '^THEORIES *=.* test_newtheory' src/Makefile.theories || error "NEWTHEORY FAILED";
96 contrib/new-theory --alternate test_newtheory test_newalttheory || error "NEWTHEORY-ALTERNATE FAILED";
97 grep -q '^THEORIES *=.* test_newalttheory' src/Makefile.theories || error "NEWTHEORY-ALTERNATE FAILED";
98 }
99 run() {
100 echo "travis_fold:start:$1"
101 echo "Running $1"
102 $1 || exit 1
103 echo "travis_fold:end:$1"
104 }
105 [ -n "$TRAVIS_CVC4" ] && [ -n "$TRAVIS_WITH_LFSC" ] && run contrib/get-lfsc-checker
106 [ -n "$TRAVIS_CVC4" ] && [ -n "$TRAVIS_CVC4_DISTCHECK" ] && run addNewTheoryTest
107 [ -n "$TRAVIS_CVC4" ] && run configureCVC4
108 [ -n "$TRAVIS_CVC4" ] && [ -n "$TRAVIS_CVC4_DISTCHECK" ] && run makeDistcheck
109 [ -n "$TRAVIS_CVC4" ] && [ -z "$TRAVIS_CVC4_DISTCHECK" ] && run makeCheck && run makeExamples
110 [ -n "$TRAVIS_CVC4" ] && [ -n "$TRAVIS_CVC4_CHECK_PORTFOLIO" ] && run makeCheckPortfolio
111 [ -n "$TRAVIS_COVERITY" ] && echo "Running coverity. Skipping the normal build."
112 [ -z "$TRAVIS_CVC4" ] && [ -z "$TRAVIS_COVERITY" ] && error "Unknown Travis-CI configuration"
113 echo "travis_fold:end:load_script"
114 - echo; echo "${green}EVERYTHING SEEMED TO PASS!${normal}"
115 - ccache -s
116 matrix:
117 fast_finish: true
118 include:
119 # Test with GCC7
120 - addons:
121 apt:
122 sources:
123 - ubuntu-toolchain-r-test
124 packages:
125 - *common_deps
126 - g++-7
127 env:
128 - MATRIX_EVAL='CC=gcc-7 && CXX=g++-7'
129 - TRAVIS_CVC4=yes TRAVIS_WITH_LFSC=yes TRAVIS_CVC4_CONFIG='debug --with-lfsc --disable-debug-symbols' TEST_GROUP=0
130 - addons:
131 apt:
132 sources:
133 - ubuntu-toolchain-r-test
134 packages:
135 - *common_deps
136 - g++-7
137 env:
138 - MATRIX_EVAL='CC=gcc-7 && CXX=g++-7'
139 - TRAVIS_CVC4=yes TRAVIS_WITH_LFSC=yes TRAVIS_CVC4_CONFIG='debug --with-lfsc --disable-debug-symbols' TEST_GROUP=1
140 # Rule for running Coverity Scan.
141 - os: linux
142 compiler: gcc
143 env:
144 - TRAVIS_COVERITY=yes CVC4_REGRESSION_ARGS='--no-early-exit'
145 addons:
146 # Need to duplicate as addons will be over written.
147 apt:
148 sources:
149 - ubuntu-toolchain-r-test
150 packages:
151 - *common_deps
152 coverity_scan:
153 project:
154 name: "CVC4/CVC4"
155 description: "Build submitted via Travis CI"
156 notification_email: timothy.alan.king@gmail.com
157 build_command_prepend: "./autogen.sh; ./configure --enable-unit-testing --enable-proof"
158 build_command: "make V=1 -j4"
159 branch_pattern: coverity_scan
160 after_failure:
161 - cat /home/travis/build/CVC4/CVC4/cov-int/build-log.txt
162
163 notifications:
164 email:
165 on_success: change
166 on_failure: always