-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #33 from banditcpp/docker
More CI builds This pull request adds more builds to AppVeyor and Travis CI. Different compilers and different standards are tested. The build environments for Travis CI are realized using Docker images. A clang-format-4.0-based style check is added to the CI. This is realized by exploiting undocumented Travis CI behavior, see travis-ci/travis-ci#2646 (comment) `cross_compile.sh` is removed and some new shell scripts are added in a new `util/` directory.
- Loading branch information
Showing
8 changed files
with
135 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
environment: | ||
matrix: | ||
- CXX_STANDARD: 98 | ||
- CXX_STANDARD: 03 | ||
- CXX_STANDARD: 11 | ||
- CXX_STANDARD: 14 | ||
|
||
build_script: | ||
- cmake -G "Visual Studio 14" -DSNOWHOUSE_RUN_TESTS=0 -DSNOWHOUSE_CXX_STANDARD=C++%CXX_STANDARD% | ||
- cmake --build . | ||
test_script: | ||
- bin\Debug\snowhouse-tests.exe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,45 @@ | ||
language: cpp | ||
sudo: required | ||
|
||
compiler: | ||
- gcc | ||
- clang | ||
# language: none <- no language, please, but this is not possible, so it takes Ruby. | ||
|
||
env: | ||
- CPP11=OFF | ||
- CPP11=ON | ||
matrix: | ||
include: | ||
# Check if coding style is okay | ||
- env: BUILD_TYPE=coding-style-check | ||
|
||
services: docker | ||
|
||
before_install: | ||
- sudo apt-get -qq update | ||
- sudo apt-get install -y findutils | ||
|
||
before_install: | ||
- sudo add-apt-repository ppa:kubuntu-ppa/backports -y | ||
- sudo apt-get update -qq | ||
- sudo apt-get install -qq cmake=2.8.12.2-0ubuntu1~ubuntu12.04.1~ppa2 | ||
script: | ||
- git ls-files '*.cpp' '*.h' | | ||
xargs | ||
docker run -v"$PWD":/media/ banditcpp/build-environments:clang-format-4.0 | ||
clang-format-4.0 -i && | ||
git diff && | ||
git diff-index --quiet HEAD | ||
|
||
before_script: | ||
- cmake -DSNOWHOUSE_IS_CPP11=${CPP11} . | ||
services: | ||
- docker | ||
|
||
env: | ||
- DOCKER_TAG=snowhouse-minimum CXX_STANDARD=98 CC=gcc-4.4 CXX=g++-4.4 | ||
- DOCKER_TAG=snowhouse-minimum CXX_STANDARD=98 CC=gcc-4.6 CXX=g++-4.6 | ||
- DOCKER_TAG=snowhouse-minimum CXX_STANDARD=03 CC=gcc-4.6 CXX=g++-4.6 | ||
- DOCKER_TAG=snowhouse-minimum CXX_STANDARD=98 CC=clang CXX=clang++ | ||
- DOCKER_TAG=snowhouse-minimum CXX_STANDARD=03 CC=clang CXX=clang++ | ||
- DOCKER_TAG=snowhouse-minimum CXX_STANDARD=11 CC=clang CXX=clang++ | ||
- DOCKER_TAG=debian-jessie-compilers CXX_STANDARD=98 CC=gcc-4.8 CXX=g++-4.8 | ||
- DOCKER_TAG=debian-jessie-compilers CXX_STANDARD=03 CC=gcc-4.8 CXX=g++-4.8 | ||
- DOCKER_TAG=debian-jessie-compilers CXX_STANDARD=11 CC=gcc-4.8 CXX=g++-4.8 | ||
- DOCKER_TAG=debian-jessie-compilers CXX_STANDARD=98 CC=gcc-4.9 CXX=g++-4.9 | ||
- DOCKER_TAG=debian-jessie-compilers CXX_STANDARD=11 CC=gcc-4.9 CXX=g++-4.9 | ||
- DOCKER_TAG=debian-jessie-compilers CXX_STANDARD=98 CC=clang-3.5 CXX=clang++-3.5 | ||
- DOCKER_TAG=debian-jessie-compilers CXX_STANDARD=11 CC=clang-3.5 CXX=clang++-3.5 | ||
- DOCKER_TAG=debian-stretch-compilers CXX_STANDARD=11 CC=gcc-6 CXX=g++-6 | ||
- DOCKER_TAG=debian-stretch-compilers CXX_STANDARD=11 CC=clang-3.9 CXX=clang++-3.9 | ||
|
||
script: | ||
- make | ||
- util/build-in-container.sh ${CXX_STANDARD} banditcpp/build-environments:${DOCKER_TAG} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/sh | ||
|
||
if test "$#" -ne 2 | ||
then | ||
echo "Usage: $0 (98|03|11|14) <docker image>" >&2 | ||
exit 2 | ||
fi | ||
|
||
SRCDIR=/usr/src/snowhouse | ||
docker run \ | ||
-v "$PWD":"$SRCDIR" \ | ||
-e "SRCDIR=$SRCDIR" \ | ||
-e "CC=$CC" \ | ||
-e "CXX=$CXX" \ | ||
"$2" "$SRCDIR"/util/build.sh "$1" "$2" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/bin/sh | ||
|
||
test -n "$SRCDIR" || SRCDIR=. | ||
test -n "$CC" || CC=cc | ||
test -n "$CXX" || CXX=c++ | ||
|
||
cxxstandard="$1" | ||
case "$cxxstandard" in | ||
98|03|11|14) | ||
;; | ||
*) | ||
echo "Usage: $0 (98|03|11|14) [image name]" >&2 | ||
exit 1 | ||
esac | ||
|
||
image="$2" | ||
test -n "$image" || image=default | ||
|
||
buildpath="builds/$(basename "$image" | sed 's/^.*://')/$(basename "$CXX")/std$cxxstandard" | ||
|
||
echo "Build settings:" | ||
echo " * source directory: $SRCDIR" | ||
echo " * C compiler: $CC" | ||
echo " * C++ compiler: $CXX" | ||
echo " * C++ standard: C++$cxxstandard" | ||
echo " * image: $image" | ||
echo " * build path: $buildpath" | ||
|
||
mkdir -p "$SRCDIR/$buildpath" | ||
cd "$SRCDIR/$buildpath" | ||
cmake -D"SNOWHOUSE_CXX_STANDARD=C++$cxxstandard" "$SRCDIR" || exit | ||
cmake --build . || exit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/sh | ||
# Reformat all tracked files (run this from snowhouse git root directory, | ||
# not from util!) | ||
|
||
DEFAULT_FORMAT_TOOL=clang-format-4.0 | ||
test -n "$FORMATTER" || FORMATTER="$(command -v "$DEFAULT_FORMAT_TOOL")" | ||
|
||
if test -z "$FORMATTER" | ||
then | ||
echo "Error: No '$DEFAULT_FORMAT_TOOL' executable found in PATH" >&2 | ||
echo "You can define your clang-format path by setting the FORMATTER variable" >&2 | ||
exit 2 | ||
fi | ||
|
||
git ls-files '*.cpp' '*.h' | xargs "$FORMATTER" -i |