Skip to content

Commit a14393b

Browse files
committed
Reorganized Travis script to use a common SH_PREFIX
1 parent 895b525 commit a14393b

File tree

1 file changed

+7
-15
lines changed

1 file changed

+7
-15
lines changed

.travis.yml

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,17 @@ matrix:
3131
- docker
3232
env: DOCKER=ubuntu:latest COMPILER=c++ COVERAGE=ON
3333

34-
3534
before_install:
3635
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; brew cask uninstall --force oclint; ./install-macos-deps.sh; fi
3736
- |
3837
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
3938
if [[ -n "$DOCKER" ]]; then
4039
docker pull $DOCKER
4140
CONTAINER_ID=$(docker run --detach --tty --volume="$PWD":/ariadne --workdir=/ariadne $DOCKER)
42-
DOCKER_RUN="docker exec --tty $CONTAINER_ID"
43-
$DOCKER_RUN sh -c "apt update"
44-
$DOCKER_RUN sh -c "apt install -y curl cmake"
45-
$DOCKER_RUN sh -c "apt install -y clang++-5.0 libboost-system-dev libboost-serialization-dev libboost-thread-dev libgtk2.0-dev libcairo2-dev libbdd-dev"
41+
SH_PREFIX="docker exec --tty $CONTAINER_ID"
42+
$SH_PREFIX sh -c "apt update"
43+
$SH_PREFIX sh -c "apt install -y curl cmake"
44+
$SH_PREFIX sh -c "apt install -y clang++-5.0 libboost-system-dev libboost-serialization-dev libboost-thread-dev libgtk2.0-dev libcairo2-dev libbdd-dev"
4645
else
4746
sudo apt-get install -y libboost-system-dev libboost-serialization-dev libboost-thread-dev libgtk2.0-dev libcairo2-dev libbdd-dev
4847
fi
@@ -51,16 +50,9 @@ before_install:
5150
script:
5251
- CMAKE_ARGS="-DCMAKE_CXX_COMPILER=$COMPILER"
5352
- if [[ -n "$COVERAGE" ]]; then CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_BUILD_TYPE=Debug"; fi
54-
- if [[ -n "$DOCKER" ]]; then $DOCKER_RUN sh -c "cmake . $CMAKE_ARGS"; fi
55-
- if [[ -z "$DOCKER" ]]; then cmake . $CMAKE_ARGS; fi
56-
- |
57-
if [[ -n "$DOCKER" ]]; then
58-
$DOCKER_RUN sh -c "make tests"
59-
$DOCKER_RUN sh -c "make test"
60-
else
61-
make tests
62-
make test
63-
fi
53+
- $SH_PREFIX sh -c "cmake . $CMAKE_ARGS"
54+
- $SH_PREFIX sh -c "make tests"
55+
- $SH_PREFIX sh -c "make test"
6456

6557
after_success:
6658
- if [[ -n "$COVERAGE" ]]; then bash <(curl -s https://codecov.io/bash); fi

0 commit comments

Comments
 (0)