summaryrefslogtreecommitdiff
path: root/.travis.yml
blob: 436e03755c70e6d49612b424b0703bdae69724c9 (plain)
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
# Build matrix / environment variables are explained on:
# http://about.travis-ci.org/docs/user/build-configuration/
# This file can be validated on: http://lint.travis-ci.org/

language: cpp
dist: xenial
osx_image: xcode10.2

compiler:
- gcc
- clang
os:
- linux
- osx

env:
- BUILD_TYPE=Debug
- BUILD_TYPE=RelWithDebInfo

addons:
  apt:
    sources:
    - llvm-toolchain-xenial-8
    - ubuntu-toolchain-r-test
    packages:
    - clang-8
    - cmake
    - gcc-8
    - g++-8
    - libgoogle-perftools-dev
    - libkyotocabinet-dev
    - libsnappy-dev
    - libsqlite3-dev
    - ninja-build
  homebrew:
    packages:
    - cmake
    - crc32c
    - gcc@8
    - gperftools
    - kyotocabinet
    - llvm@8
    - ninja
    - snappy
    - sqlite3
    update: true

install:
# The following Homebrew packages aren't linked by default, and need to be
# prepended to the path explicitly.
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then
    export PATH="$(brew --prefix llvm)/bin:$PATH";
  fi
# /usr/bin/gcc points to an older compiler on both Linux and macOS.
- if [ "$CXX" = "g++" ]; then export CXX="g++-8" CC="gcc-8"; fi
# /usr/bin/clang points to an older compiler on both Linux and macOS.
#
# Homebrew's llvm package doesn't ship a versioned clang++ binary, so the values
# below don't work on macOS. Fortunately, the path change above makes the
# default values (clang and clang++) resolve to the correct compiler on macOS.
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then
    if [ "$CXX" = "clang++" ]; then export CXX="clang++-8" CC="clang-8"; fi;
  fi
- echo ${CC}
- echo ${CXX}
- ${CXX} --version
- cmake --version

before_script:
- mkdir -p build && cd build
- cmake .. -G Ninja -DCMAKE_BUILD_TYPE=$BUILD_TYPE
- cmake --build .
- cd ..

script:
- cd build && ctest --verbose && cd ..
- "if [ -f build/db_bench ] ; then build/db_bench ; fi"
- "if [ -f build/db_bench_sqlite3 ] ; then build/db_bench_sqlite3 ; fi"
- "if [ -f build/db_bench_tree_db ] ; then build/db_bench_tree_db ; fi"