Skip to content

Commit

Permalink
Cloud CI: updated for travis OSX + Ubuntu. Simplified setup (#301)
Browse files Browse the repository at this point in the history
* updated for travis OSX + Ubuntu. Simplified setup

* more robust script for test
  • Loading branch information
Kjell Hedström authored Feb 19, 2019
1 parent e8a07f2 commit cb4a94d
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 61 deletions.
71 changes: 13 additions & 58 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,67 +1,22 @@
sudo: required
language: cpp

os:
- linux
matrix:
include:
- os: linux
dist: xenial
- os: osx
osx_image: xcode10.1

dist: trusty

compiler:
- gcc
#- clang
compiler:
- gcc
# - clang

# whitelist
branches:
only:
- master
before_install:
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then uname -a; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then echo uname -a; sudo sh scripts/.travis-bootstrap-ubuntu.sh; fi


before_install:

if [ ${TRAVIS_OS_NAME} = 'linux' ];
then


sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test;

sudo add-apt-repository -y ppa:george-edison55/precise-backports;

sudo apt-get remove -qq cmake cmake-data
sudo apt-get autoremove -qq

sudo apt-get update -qq;
sudo apt-get install python-software-properties;
sudo apt-get update;
sudo apt-get install gcc-5 g++-5;
sudo apt-get install software-properties-common;
sudo apt-get update;
sudo apt-get update -qq;
sudo apt-get install cmake cmake-data;
fi

install:
# gcc 5
- if [ "$CXX" == "g++" ]; then sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 10; fi
- if [ "$CXX" == "g++" ]; then sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-5 10; fi

# clang 3.4
- if [ "$CXX" == "clang++" ]; then sudo apt-get install --allow-unauthenticated -qq clang-3.4; fi
- if [ "$CXX" == "clang++" ]; then sudo apt-get install libc++1 libc++abi-dev || true; fi

- if [ "$CXX" == "clang++" ]; then export CXXFLAGS="-std=c++0x -stdlib=libc++"; fi
- if [ "$CXX" == "clang++" ]; then svn co --quiet http://llvm.org/svn/llvm-project/libcxx/trunk libcxx; fi

- if [ "$CXX" == "clang++" ]; then cd libcxx/lib && bash buildit; fi
- if [ "$CXX" == "clang++" ]; then sudo cp ./libc++.so.1.0 /usr/lib/; fi
- if [ "$CXX" == "clang++" ]; then sudo mkdir /usr/include/c++/v1; fi
- if [ "$CXX" == "clang++" ]; then cd .. && sudo cp -r include/* /usr/include/c++/v1/; fi
- if [ "$CXX" == "clang++" ]; then cd /usr/lib && sudo ln -sf libc++.so.1.0 libc++.so; fi
- if [ "$CXX" == "clang++" ]; then sudo ln -sf libc++.so.1.0 libc++.so.1 && cd $cwd; fi
# - if [ "${TRAVIS_OS_NAME}" = "osx" ]; then brew update; fi
- echo $PWD
- echo $CXX
- if [ "$CXX" == "clang++" ]; then cd build/KjellKod/g3log || true; fi
- echo $PWD

script: "./scripts/buildAndRunTests.sh"


Expand Down
18 changes: 18 additions & 0 deletions scripts/.travis-bootstrap-ubuntu.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash

set -ev
set -x

apt-get update -y
apt-get install -y apt-utils | true
apt-get install -y software-properties-common | true
apt-get install -y python-software-properties
apt-get update -y
add-apt-repository -y ppa:jonathonf/gcc-7.1
apt-get update -y
apt-get install -y cmake software-properties-common git make
apt-get install -y gcc-7 g++-7
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 90
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-7 90
apt-get install -y unzip zlib1g-dev
apt-get install -y libboost-all-dev
4 changes: 2 additions & 2 deletions scripts/buildAndRunTests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ mkdir -p build_travis
cd build_travis
cmake -DCMAKE_CXX_FLAGS=-std=c++14 -DADD_G3LOG_BENCH_PERFORMANCE=ON -DADD_G3LOG_UNIT_TEST=ON ..

makeArg=`grep -c ^processor /proc/cpuinfo`
#makeArg=`grep -c ^processor /proc/cpuinfo`

make -j$makeArg
make -j
/bin/bash ../scripts/runAllTests.sh

2 changes: 1 addition & 1 deletion scripts/runAllTests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
set -v

# test_execs=`find ./test_* -perm /u=x`
test_execs=`find ./test_* -type f -perm +ugo+x -print`
test_execs=`find ./test_* -perm -u+x -type f`

echo "Tests to run: $test_execs"
while read -r testsuite; do
Expand Down

0 comments on commit cb4a94d

Please sign in to comment.