Skip to content

Commit

Permalink
Merge pull request mat007#90 from Flamefire/ci
Browse files Browse the repository at this point in the history
Fix and improve CI
  • Loading branch information
mat007 committed Jul 15, 2020
2 parents bbe01e6 + 626c3b8 commit 62494bc
Show file tree
Hide file tree
Showing 27 changed files with 56 additions and 1,915 deletions.
48 changes: 19 additions & 29 deletions .travis.yml
Expand Up @@ -16,12 +16,11 @@ branches:
- master

env:
- CXX_STANDARD=c++17 BRANCH_TO_TEST=master
- CXX_STANDARD=c++14 BRANCH_TO_TEST=master
- CXX_STANDARD=c++11 BRANCH_TO_TEST=master
- CXX_STANDARD=c++11 BRANCH_TO_TEST=boost-1.58.0
- CXX_STANDARD=c++11 BRANCH_TO_TEST=boost-1.59.0
- CXX_STANDARD=c++11 BRANCH_TO_TEST=boost-1.67.0
- CXX_STANDARD=17 BRANCH_TO_TEST=master
- CXX_STANDARD=14 BRANCH_TO_TEST=master
- CXX_STANDARD=14 BRANCH_TO_TEST=boost-1.58.0
- CXX_STANDARD=14 BRANCH_TO_TEST=boost-1.59.0
- CXX_STANDARD=14 BRANCH_TO_TEST=boost-1.67.0

compiler:
- clang
Expand All @@ -40,6 +39,8 @@ addons:
- xsltproc
- docbook-xsl
- docbook-xml
- python-yaml
- lcov

before_install:
- DOCBOOK_XSL_DIR=/usr/share/xml/docbook/stylesheet/docbook-xsl
Expand All @@ -60,44 +61,33 @@ before_install:
- PROJECT_DIR=`pwd`
- git --version
- BOOST=$HOME/boost-local
- git clone -b $BRANCH_TO_TEST https://github.com/boostorg/boost.git $BOOST
- git clone -b $BRANCH_TO_TEST --depth 1 https://github.com/boostorg/boost.git $BOOST
- cd $BOOST
- git submodule update --init --merge
- git submodule update --init --depth 1
- ./bootstrap.sh
- ./b2 headers

script:
- cd $PROJECT_DIR/build
- cd $PROJECT_DIR
- export BOOST_ROOT=$BOOST
# `--coverage` flags required to generate coverage info for Coveralls
- ./build.sh --toolset=$CC "cxxflags=-std=$CXX_STANDARD -Wno-unused-local-typedefs -Wno-unused-function -Wno-deprecated-declarations --coverage" "linkflags=--coverage" -j3
- build/build.sh --toolset=$CC "cxxflags=-std=c++$CXX_STANDARD -Wno-unused-local-typedefs -Wno-unused-function -Wno-deprecated-declarations --coverage" "linkflags=--coverage" -j3
# CMake build
- cd $BOOST && ./b2 --with-test --with-thread --with-chrono --with-system --with-atomic --with-date_time -a -j3 # Build required libs
- mkdir $PROJECT_DIR/__build && cd $PROJECT_DIR/__build
- export CXXFLAGS="-std=$CXX_STANDARD"
- cmake .. -DCMAKE_BUILD_TYPE=Debug
- cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="-std=c++$CXX_STANDARD"
- cmake --build . --config Debug -- -j3
- ctest --output-on-failure --build-config Debug

after_success:
- COVERALS_DIR=$PROJECT_DIR/coverals

# Copying Coveralls data to a separate folder
- mkdir -p $COVERALS_DIR
- find $PROJECT_DIR/test/bin/ -name "*.gcda" -exec cp "{}" $COVERALS_DIR/ \;
- find $PROJECT_DIR/test/bin/ -name "*.gcno" -exec cp "{}" $COVERALS_DIR/ \;

- cd $PROJECT_DIR
# Preparing Coveralls data by
# ... installing the tools
- sudo apt-get install -qq python-yaml lcov
# ... changing data format to a readable one
- lcov --directory $COVERALS_DIR --base-directory $PROJECT_DIR/test --capture --output-file $COVERALS_DIR/coverage.info

# ... erasing /test/ /example/ folder data
- lcov --remove $COVERALS_DIR/coverage.info "/usr*" "/test/*" $IGNORE_COVERAGE "tests/*" "*/doc/examples/*" -o $COVERALS_DIR/coverage.info
- lcov --directory "$PROJECT_DIR/test" --capture --output-file coverage.info
# ... erasing /test/ /doc/example/ folder data
- lcov --remove coverage.info "/usr*" $IGNORE_COVERAGE "*/test/*" "*/doc/example/*" -o coverage.info
# Output what was collected
- lcov --list $COVERALS_DIR/coverage.info

- lcov --list coverage.info
# Sending data to Coveralls
- cd $PROJECT_DIR
- gem install coveralls-lcov
- coveralls-lcov $COVERALS_DIR/coverage.info
- coveralls-lcov coverage.info
10 changes: 6 additions & 4 deletions appveyor.yml
Expand Up @@ -33,7 +33,8 @@ environment:
CMAKE: true

install:
- cd %APPVEYOR_BUILD_FOLDER%\doc
- mkdir %APPVEYOR_BUILD_FOLDER%\bin
- cd %APPVEYOR_BUILD_FOLDER%\bin
- appveyor-retry powershell Invoke-WebRequest ftp://ftp.zlatkovic.com/libxml/iconv-1.9.2.win32.zip -OutFile iconv.zip
- 7z e iconv.zip iconv.dll -r
- appveyor-retry powershell Invoke-WebRequest ftp://ftp.zlatkovic.com/libxml/libxml2-2.7.8.win32.zip -OutFile libxml2.zip
Expand All @@ -45,13 +46,14 @@ install:
- xsltproc -V

build_script:
- set PATH=%PATH%;%APPVEYOR_BUILD_FOLDER%\bin
- set BOOST_ROOT=C:\Libraries\boost_%BOOST%
- cd %BOOST_ROOT%
- call bootstrap.bat
- cd %APPVEYOR_BUILD_FOLDER%\build
- cd %APPVEYOR_BUILD_FOLDER%
- if NOT "%CXX_STANDARD%"=="" set CXX_FLAGS=cxxflags=/std:c++%CXX_STANDARD%
- set BUILD_ARGS=address-model=32,64 variant=debug,release
- call build.bat --toolset=%TOOLSET% %CXX_FLAGS% -j3
- call build\build.bat --toolset=%TOOLSET% %CXX_FLAGS% -j3

for:
- matrix:
Expand All @@ -64,4 +66,4 @@ for:
- cd __build
- cmake .. -DCMAKE_BUILD_TYPE=Debug
- cmake --build . --config Debug
- ctest --output-on-failure --build-config Debug
- ctest --output-on-failure --build-config Debug
23 changes: 12 additions & 11 deletions build/build.bat
Expand Up @@ -9,21 +9,22 @@ setlocal

rem error if BOOST_ROOT not set
set BOOST=%BOOST_ROOT%
set PROJECT_DIR=%cd%

pushd ..\test
%BOOST%\b2.exe -q %BUILD_ARGS% %*
popd
cd %BOOST%
b2.exe %PROJECT_DIR%\test -q %BUILD_ARGS% %*
if errorlevel 1 exit /b %ERRORLEVEL%

set BOOSTBOOK_DIR=..\bin\turtle\boostbook
cd %PROJECT_DIR%
set BOOSTBOOK_DIR=%PROJECT_DIR%\bin\turtle\boostbook
xcopy /Y /S /Q /I %BOOST%\tools\boostbook\xsl %BOOSTBOOK_DIR%\xsl
xcopy /Y /S /Q /I %BOOST%\tools\boostbook\dtd %BOOSTBOOK_DIR%\dtd
xcopy /Y /S /Q /I boostbook %BOOSTBOOK_DIR%
xcopy /Y /S /Q /I %BOOST%\doc\src\boostbook.css ..\doc\html
xcopy /Y /S /Q /I %BOOST%\doc\src\images\*.png ..\doc\html\images
xcopy /Y /S /Q /I %BOOST%\doc\src\images\callouts\*.png ..\doc\html\images\callouts
xcopy /Y /S /Q /I build\boostbook %BOOSTBOOK_DIR%
xcopy /Y /S /Q /I %BOOST%\doc\src\boostbook.css doc\html
xcopy /Y /S /Q /I %BOOST%\doc\src\images\*.png doc\html\images
xcopy /Y /S /Q /I %BOOST%\doc\src\images\callouts\*.png doc\html\images\callouts
if errorlevel 1 exit /b %ERRORLEVEL%
pushd ..\doc
%BOOST%\b2.exe -q %*
popd

cd %BOOST%
b2.exe %PROJECT_DIR%\doc -q %*
if errorlevel 1 exit /b %ERRORLEVEL%
35 changes: 18 additions & 17 deletions build/build.sh
Expand Up @@ -8,25 +8,26 @@
copy()
{
for dir; do true; done
mkdir -p $dir
cp $@
mkdir -p "$dir"
cp "$@"
}

set -ex
set -eux

export BOOST=$BOOST_ROOT
export BOOST="$BOOST_ROOT"
PROJECT_DIR="$(pwd)"

cd ../test
$BOOST/b2 -q "$@"
cd ../build
cd "$BOOST"
./b2 "$PROJECT_DIR/test" -q "$@"

export BOOSTBOOK_DIR=../bin/turtle/boostbook
copy -r "$BOOST"/tools/boostbook/xsl $BOOSTBOOK_DIR
copy -r "$BOOST"/tools/boostbook/dtd $BOOSTBOOK_DIR
copy -r boostbook/* $BOOSTBOOK_DIR
copy "$BOOST"/doc/src/boostbook.css ../doc/html
copy "$BOOST"/doc/src/images/*.png ../doc/html/images
copy "$BOOST"/doc/src/images/callouts/*.png ../doc/html/images/callouts
cd ../doc
$BOOST/b2 -q "$@"
cd ../build
cd "$PROJECT_DIR"
export BOOSTBOOK_DIR="$PROJECT_DIR/bin/turtle/boostbook"
copy -r "$BOOST"/tools/boostbook/xsl "$BOOSTBOOK_DIR"
copy -r "$BOOST"/tools/boostbook/dtd "$BOOSTBOOK_DIR"
copy -r build/boostbook/* "$BOOSTBOOK_DIR"
copy "$BOOST"/doc/src/boostbook.css doc/html
copy "$BOOST"/doc/src/images/*.png doc/html/images
copy "$BOOST"/doc/src/images/callouts/*.png doc/html/images/callouts

cd "$BOOST"
./b2 "$PROJECT_DIR/doc" -q "$@"
7 changes: 0 additions & 7 deletions build/vc100/.gitignore

This file was deleted.

35 changes: 0 additions & 35 deletions build/vc100/turtle.sln

This file was deleted.

0 comments on commit 62494bc

Please sign in to comment.