Skip to content
Snippets Groups Projects
Commit d337ce6d authored by Konstantinos Sideris's avatar Konstantinos Sideris
Browse files

Add travis-ci

parent 192ccd81
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/env bash
set -evx
sudo apt-get -qq update
sudo apt-get install -y libgtest-dev
wget https://github.com/google/googletest/archive/release-1.8.0.tar.gz
tar xf release-1.8.0.tar.gz
cd googletest-release-1.8.0
cmake -DBUILD_SHARED_LIBS=ON .
make
sudo cp -a googletest/include/gtest /usr/include
sudo cp -a googlemock/gtest/*.so /usr/lib/
sudo ldconfig -v | grep gtest
cd $TRAVIS_BUILD_DIR
---
language: cpp
sudo: required
dist: trusty
services:
- docker
notifications:
email: false
matrix:
include:
- os: osx
osx_image: xcode8
compiler: clang
- os: linux
compiler: gcc
env:
- CXX_VERSION=g++-6
addons:
apt:
sources:
- "ubuntu-toolchain-r-test"
packages:
- "g++-6"
- os: linux
compiler: gcc
env:
- CXX_VERSION=g++-7
addons:
apt:
sources:
- "ubuntu-toolchain-r-test"
packages:
- "g++-7"
- os: linux
compiler: clang
env:
- CXX_VERSION=clang++-5.0
- LINT=ON
addons:
apt:
sources:
- "ubuntu-toolchain-r-test"
- "llvm-toolchain-trusty-5.0"
packages:
- "clang++-5.0"
- "clang-5.0"
- "g++-7"
- "clang-format"
install:
- if [ $TRAVIS_OS_NAME == linux ]; then ./.ci/gtest.sh; fi
- if [ $TRAVIS_OS_NAME == linux ]; then sudo add-apt-repository -y ppa:george-edison55/cmake-3.x; fi
- if [ $TRAVIS_OS_NAME == linux ]; then sudo apt-get update -qq; fi
- if [ $TRAVIS_OS_NAME == linux ]; then sudo apt-get install -qq -y cmake; fi
script:
- if [[ "${CXX_VERSION}" != "" ]]; then export CXX=${CXX_VERSION}; fi
- $CXX --version
- cmake --version
# Build library, examples & tests
- cmake -H. -Bbuild
- cmake --build build
# Unit & Integration tests
- make synapse
- make test
- make stop-synapse
# Linting
- if [ $LINT == ON ]; then make lint; fi
FILES=`find src tests examples -type f -type f \( -iname "*.cpp" -o -iname "*.hpp" \)`
debug:
@cmake -GNinja -H. -Bbuild -DCMAKE_BUILD_TYPE=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl
@cmake --build build
......@@ -30,5 +32,8 @@ stop-synapse:
@rm -rf ./data/*
@docker rm -f synapse 2>&1>/dev/null
lint:
@clang-format -i ${FILES} && git diff --exit-code
clean:
rm -rf build
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment