From fde2af5841c797ab16ea59e448d42360735980b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20L=C3=BChne?= Date: Sat, 24 Mar 2018 18:10:58 +0100 Subject: [PATCH] Add clang to Travis configurations This adds the clang compiler to the tested Travis configurations. --- .ci/Dockerfile-arch-latest | 3 +++ .ci/Dockerfile-ubuntu-18.04 | 3 +++ .ci/ci.sh | 12 +++++++++++- .travis.yml | 14 ++++++++++---- 4 files changed, 27 insertions(+), 5 deletions(-) diff --git a/.ci/Dockerfile-arch-latest b/.ci/Dockerfile-arch-latest index faa2ab2..af2962f 100644 --- a/.ci/Dockerfile-arch-latest +++ b/.ci/Dockerfile-arch-latest @@ -1,6 +1,9 @@ FROM archimg/base-devel:latest +ARG toolchain + RUN pacman -Sy RUN pacman -S --noconfirm boost cmake git ninja re2c +RUN if [ "${toolchain}" = "clang" ]; then pacman -S --noconfirm clang; fi VOLUME /app diff --git a/.ci/Dockerfile-ubuntu-18.04 b/.ci/Dockerfile-ubuntu-18.04 index a99a280..d635e83 100644 --- a/.ci/Dockerfile-ubuntu-18.04 +++ b/.ci/Dockerfile-ubuntu-18.04 @@ -1,6 +1,9 @@ FROM ubuntu:18.04 +ARG toolchain + RUN apt-get update RUN apt-get install -y libboost-all-dev cmake git ninja-build re2c +RUN if [ "${toolchain}" = "clang" ]; then apt-get install -y clang; fi VOLUME /app diff --git a/.ci/ci.sh b/.ci/ci.sh index c283921..1575b2e 100755 --- a/.ci/ci.sh +++ b/.ci/ci.sh @@ -1,7 +1,17 @@ #!/bin/bash +if [ "$1" = "gcc" ] +then + cxx=g++ + cc=gcc +elif [ "$1" = "clang" ] +then + cxx=clang++ + cc=clang +fi + git submodule update --init --recursive mkdir -p build/debug cd build/debug -cmake ../.. -GNinja -DANTHEM_BUILD_TESTS=ON +cmake ../.. -GNinja -DANTHEM_BUILD_TESTS=ON -DCMAKE_CXX_COMPILER=${cxx} -DCMAKE_C_COMPILER=${cc} ninja anthem-app && ninja run-tests diff --git a/.travis.yml b/.travis.yml index 9d22982..c2ce692 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,15 +5,21 @@ services: matrix: include: - - env: distribution=arch-latest + - env: distribution=arch-latest toolchain=gcc os: linux language: cpp - - env: distribution=ubuntu-18.04 + - env: distribution=arch-latest toolchain=clang + os: linux + language: cpp + - env: distribution=ubuntu-18.04 toolchain=gcc + os: linux + language: cpp + - env: distribution=ubuntu-18.04 toolchain=clang os: linux language: cpp before_install: - - docker build -t ${distribution} - < .ci/Dockerfile-${distribution} + - docker build --build-arg toolchain=${toolchain} -t ${distribution} - < .ci/Dockerfile-${distribution} script: - - docker run --mount source=$(pwd),target=/app,type=bind -w /app ${distribution} /bin/bash -c ".ci/ci.sh" + - docker run --mount source=$(pwd),target=/app,type=bind -w /app ${distribution} /bin/bash -c ".ci/ci.sh ${toolchain}"