Add clang build to Circle CI
This commit is contained in:
parent
29cb24b762
commit
deb47ada11
@ -7,13 +7,44 @@ references:
|
|||||||
run:
|
run:
|
||||||
name: Setup Environment
|
name: Setup Environment
|
||||||
command: |
|
command: |
|
||||||
|
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
|
||||||
|
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add -
|
||||||
|
sudo touch /etc/apt/sources.list.d/clang.list
|
||||||
|
sudo chmod o+w /etc/apt/sources.list.d/clang.list
|
||||||
|
cat > /etc/apt/sources.list.d/clang.list << EOF
|
||||||
|
#deb http://apt.llvm.org/trusty/ llvm-toolchain-trusty main
|
||||||
|
#deb-src http://apt.llvm.org/trusty/ llvm-toolchain-trusty main
|
||||||
|
deb http://apt.llvm.org/trusty/ llvm-toolchain-trusty-3.7 main
|
||||||
|
deb-src http://apt.llvm.org/trusty/ llvm-toolchain-trusty-3.7 main
|
||||||
|
deb http://apt.llvm.org/trusty/ llvm-toolchain-trusty-4.0 main
|
||||||
|
deb-src http://apt.llvm.org/trusty/ llvm-toolchain-trusty-4.0 main
|
||||||
|
deb http://apt.llvm.org/trusty/ llvm-toolchain-trusty-5.0 main
|
||||||
|
deb-src http://apt.llvm.org/trusty/ llvm-toolchain-trusty-5.0 main
|
||||||
|
EOF
|
||||||
|
sudo chmod o-w /etc/apt/sources.list.d/clang.list
|
||||||
|
|
||||||
DEBIAN_FRONTEND=noninteractive sudo apt-get update -qq
|
DEBIAN_FRONTEND=noninteractive sudo apt-get update -qq
|
||||||
DEBIAN_FRONTEND=noninteractive sudo apt-get install -y git g++ cmake make libcurl4-openssl-dev libboost-filesystem-dev libboost-system-dev libboost-chrono-dev libboost-program-options-dev libboost-thread-dev libcrypto++-dev libssl-dev libfuse-dev python
|
DEBIAN_FRONTEND=noninteractive sudo apt-get install -y git $APT_COMPILER_PACKAGE cmake make libcurl4-openssl-dev libboost-filesystem-dev libboost-system-dev libboost-chrono-dev libboost-program-options-dev libboost-thread-dev libcrypto++-dev libssl-dev libfuse-dev python
|
||||||
uname -a
|
|
||||||
cmake --version
|
|
||||||
g++ --version
|
|
||||||
# Use /dev/urandom when /dev/random is accessed to use less entropy
|
# Use /dev/urandom when /dev/random is accessed to use less entropy
|
||||||
sudo cp -a /dev/urandom /dev/random
|
sudo cp -a /dev/urandom /dev/random
|
||||||
|
|
||||||
|
if [ "${BUILD_TOOLSET}" = "clang" ]; then
|
||||||
|
# They aren't set automatically unfortunately
|
||||||
|
sudo ln -s /usr/bin/$CC /usr/bin/clang
|
||||||
|
sudo ln -s /usr/bin/$CXX /usr/bin/clang++
|
||||||
|
|
||||||
|
# Need a c++14 compliant STL for clang
|
||||||
|
sudo apt-get install g++-5
|
||||||
|
sudo apt-get remove g++-4.8 gcc-4.8
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo
|
||||||
|
echo System Info:
|
||||||
|
cat /etc/issue
|
||||||
|
uname -a
|
||||||
|
cmake --version
|
||||||
|
$CC --version
|
||||||
|
$CXX --version
|
||||||
upgrade_boost: &upgrade_boost
|
upgrade_boost: &upgrade_boost
|
||||||
run:
|
run:
|
||||||
name: Upgrade Boost
|
name: Upgrade Boost
|
||||||
@ -36,49 +67,68 @@ references:
|
|||||||
echo Extracting...
|
echo Extracting...
|
||||||
tar -xf boost.tar.bz2
|
tar -xf boost.tar.bz2
|
||||||
cd boost_1_56_0
|
cd boost_1_56_0
|
||||||
./bootstrap.sh --with-libraries=filesystem,thread,chrono,program_options
|
./bootstrap.sh --with-toolset=${BUILD_TOOLSET} --with-libraries=filesystem,thread,chrono,program_options
|
||||||
sudo ./b2 link=static cxxflags=-fPIC -d0 -j$NUMCORES install
|
sudo ./b2 toolset=${BUILD_TOOLSET} link=static cxxflags=-fPIC -d0 -j$NUMCORES install
|
||||||
cd ..
|
cd ..
|
||||||
sudo rm -rf boost.tar.bz2 boost_1_56_0
|
sudo rm -rf boost.tar.bz2 boost_1_56_0
|
||||||
|
build: &build
|
||||||
jobs:
|
run:
|
||||||
build:
|
name: Build
|
||||||
|
command: |
|
||||||
|
export NUMCORES=`nproc` && if [ ! -n "$NUMCORES" ]; then export NUMCORES=`sysctl -n hw.ncpu`; fi
|
||||||
|
echo Using $NUMCORES cores
|
||||||
|
mkdir cmake
|
||||||
|
cd cmake
|
||||||
|
cmake .. -DBUILD_TESTING=on -DCMAKE_BUILD_TYPE=Debug
|
||||||
|
make -j$NUMCORES
|
||||||
|
test: &test
|
||||||
|
run:
|
||||||
|
name: Test
|
||||||
|
command: |
|
||||||
|
cd cmake
|
||||||
|
./test/gitversion/gitversion-test
|
||||||
|
./test/cpp-utils/cpp-utils-test
|
||||||
|
./test/fspp/fspp-test
|
||||||
|
./test/parallelaccessstore/parallelaccessstore-test
|
||||||
|
./test/blockstore/blockstore-test
|
||||||
|
./test/blobstore/blobstore-test
|
||||||
|
./test/cryfs/cryfs-test
|
||||||
|
./test/cryfs-cli/cryfs-cli-test
|
||||||
|
job_definition: &job_definition
|
||||||
<<: *container_config
|
<<: *container_config
|
||||||
steps:
|
steps:
|
||||||
- <<: *container_setup
|
- <<: *container_setup
|
||||||
- <<: *upgrade_boost
|
- <<: *upgrade_boost
|
||||||
- checkout
|
- checkout
|
||||||
- run:
|
- <<: *build
|
||||||
name: Build
|
- <<: *test
|
||||||
command: |
|
enable_for_tags: &enable_for_tags
|
||||||
export NUMCORES=`nproc` && if [ ! -n "$NUMCORES" ]; then export NUMCORES=`sysctl -n hw.ncpu`; fi
|
filters:
|
||||||
# Circle CI gives us 36 cores (2x9 +HT), but doesn't give us enough memory for building 36 jobs in parallel, which causes the build to fail. Restrict number of cores used.
|
tags:
|
||||||
#export NUMCORES=7
|
only: /.*/
|
||||||
echo Using $NUMCORES cores
|
|
||||||
mkdir cmake
|
jobs:
|
||||||
cd cmake
|
build_and_test_gcc:
|
||||||
cmake .. -DBUILD_TESTING=on -DCMAKE_BUILD_TYPE=Debug
|
<<: *job_definition
|
||||||
make -j$NUMCORES
|
environment:
|
||||||
- run:
|
CC: gcc-4.8
|
||||||
name: Test
|
CXX: g++-4.8
|
||||||
command: |
|
BUILD_TOOLSET: gcc
|
||||||
cd cmake
|
APT_COMPILER_PACKAGE: "g++-4.8"
|
||||||
./test/gitversion/gitversion-test
|
build_and_test_clang:
|
||||||
./test/cpp-utils/cpp-utils-test
|
<<: *job_definition
|
||||||
./test/fspp/fspp-test
|
environment:
|
||||||
./test/parallelaccessstore/parallelaccessstore-test
|
CC: clang-3.7
|
||||||
./test/blockstore/blockstore-test
|
CXX: clang++-3.7
|
||||||
./test/blobstore/blobstore-test
|
BUILD_TOOLSET: clang
|
||||||
./test/cryfs/cryfs-test
|
APT_COMPILER_PACKAGE: clang-3.7
|
||||||
./test/cryfs-cli/cryfs-cli-test
|
|
||||||
|
|
||||||
workflows:
|
workflows:
|
||||||
version: 2
|
version: 2
|
||||||
|
|
||||||
build_test:
|
build_and_test:
|
||||||
jobs:
|
jobs:
|
||||||
- build:
|
- build_and_test_gcc:
|
||||||
# Also enable this job for tags
|
<<: *enable_for_tags
|
||||||
filters:
|
- build_and_test_clang:
|
||||||
tags:
|
<<: *enable_for_tags
|
||||||
only: /.*/
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user