Skip to content

Commit a1df70c

Browse files
committed
Adding matrix for TravisCI; Makefile and CMake build processes
1 parent d0d31b5 commit a1df70c

File tree

2 files changed

+57
-3
lines changed

2 files changed

+57
-3
lines changed

.travis.yml

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
language: c++
12
sudo: false
23
env:
3-
- GXX=g++-9 CC=gcc-9
4+
- BUILD_PROCESS=make GXX=g++-9 CC=gcc-9
5+
- BUILD_PROCESS=cmake CXX=g++-9 CC=gcc-9
46
addons:
57
apt:
68
sources:
@@ -11,6 +13,9 @@ addons:
1113
notifications:
1214
email:
1315
on_success: never
16+
cache:
17+
directories:
18+
- ${HOME}/.local
1419
before_install:
1520
script: ./travis.sh
1621
dist: xenial

travis.sh

+51-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,46 @@
11
#!/bin/bash
22
set -e
33

4-
export GXX=g++-9
4+
if [[ "${BUILD_PROCESS}" = make ]]; then
5+
export GXX=g++-9
6+
else
7+
export CXX=g++-9
8+
fi
59
export CC=gcc-9
610

11+
# Install CMake into predefined path (if needed)
12+
HOME_LOCAL=${HOME}/.local
13+
CMAKE_BIN=${HOME_LOCAL}/bin/cmake
14+
CMAKE_VERSION=3.16.6
15+
if [ -f ${CMAKE_BIN} ] &&
16+
[ -z $(${CMAKE_BIN} --version | grep -q "${CMAKE_VERSION}") ]; then
17+
echo "Using cached CMake v${CMAKE_VERSION} (${HOME_LOCAL})\r${ANSI_CLEAR}"
18+
else
19+
OS_TYPE=Linux
20+
if [[ "${os}" = Darwin ]]; then
21+
OS_TYPE=Darwin
22+
fi
23+
24+
CMAKE_FILENAME=cmake-${CMAKE_VERSION}-${OS_TYPE}-x86_64.tar.gz
25+
CMAKE_URL=https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/${CMAKE_FILENAME}
26+
(
27+
cd /tmp
28+
echo -en "Downloading CMake v${CMAKE_VERSION} (${URL})\r${ANSI_CLEAR}"
29+
wget ${CMAKE_URL}
30+
echo -en "Installing CMake v${CMAKE_VERSION} (${HOME_LOCAL})\r${ANSI_CLEAR}"
31+
mkdir -p ${HOME_LOCAL}
32+
tar xzf ${CMAKE_FILENAME} -C ${HOME_LOCAL} --strip 1
33+
rm ${CMAKE_FILENAME}
34+
)
35+
fi
36+
737
${CC} --version
8-
${GXX} --version
38+
if [[ "${BUILD_PROCESS}" = make ]]; then
39+
${GXX} --version
40+
else
41+
${CXX} --version
42+
cmake --version
43+
fi
944

1045
travis_time_start() {
1146
travis_timer_id=$(printf %08x $(( RANDOM * RANDOM )))
@@ -41,6 +76,16 @@ travis_fold() {
4176
echo -en "travis_fold:${action}:${name}\r${ANSI_CLEAR}"
4277
}
4378

79+
if [[ "${BUILD_PROCESS}" = cmake ]]; then
80+
travis_fold start configure_bedrock
81+
travis_time_start
82+
mkdir build
83+
cd build
84+
cmake -DENABLE_TESTING=On ..
85+
travis_time_finish
86+
travis_fold end configure_bedrock
87+
fi
88+
4489
travis_fold start build_bedrock
4590
travis_time_start
4691
make -j8
@@ -62,3 +107,7 @@ cd test/clustertest
62107
cd ../..
63108
travis_time_finish
64109
travis_fold end test_bedrock_cluster
110+
111+
if [[ "${BUILD_PROCESS}" = cmake ]]; then
112+
cd ..
113+
fi

0 commit comments

Comments
 (0)