diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..dfb4d611 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,151 @@ +# Copyright 2022 Alexander Grund +# +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE_1_0.txt or copy at http://boost.org/LICENSE_1_0.txt) + +name: CI + +on: + pull_request: + push: + branches: + - master + - develop + - feature/** + +concurrency: + group: ${{format('{0}:{1}', github.repository, github.ref)}} + cancel-in-progress: true + +env: + NET_RETRY_COUNT: 5 + DOCBOOK_XSL_DIR: /usr/share/xml/docbook/stylesheet/docbook-xsl + DOCBOOK_DTD_DIR: /usr/share/xml/docbook/schema/dtd/4.2 + +jobs: + posix: + defaults: + run: + shell: bash + + strategy: + fail-fast: false + matrix: + include: + # Linux, gcc + - { compiler: gcc-5, cxxstd: '14', boostBranch: boost-1.65.0, os: ubuntu-18.04 } + - { compiler: gcc-5, cxxstd: '14', boostBranch: boost-1.77.0, os: ubuntu-18.04 } + - { compiler: gcc-5, cxxstd: '14,1z', boostBranch: master, os: ubuntu-18.04 } + - { compiler: gcc-11,cxxstd: '14,17,20', boostBranch: master, os: ubuntu-20.04 } + + # Linux, clang + - { compiler: clang-5.0, cxxstd: '14', boostBranch: boost-1.65.0, os: ubuntu-18.04 } + - { compiler: clang-5.0, cxxstd: '14', boostBranch: boost-1.77.0, os: ubuntu-18.04 } + - { compiler: clang-5.0, cxxstd: '14,1z', boostBranch: master, os: ubuntu-18.04 } + - { compiler: clang-12, cxxstd: '14,17,20', boostBranch: master, os: ubuntu-20.04 } + + - { name: Collect coverage, coverage: yes, + compiler: gcc-8, cxxstd: '14', boostBranch: master, os: ubuntu-18.04 } + + timeout-minutes: 120 + runs-on: ${{matrix.os}} + env: + BOOST_ROOT: ${{github.workspace}}/boost-root + PROJECT_DIR: ${{github.workspace}}/turtle + + steps: + - uses: actions/checkout@v2 + if: '!matrix.coverage' + with: + path: turtle + - uses: actions/checkout@v2 + if: 'matrix.coverage' + with: + path: turtle + fetch-depth: 0 + # Checking out Boost and all its submodules takes ages... + - name: Cache Boost + uses: actions/cache@v2 + with: + path: boost-root + key: boost-${{matrix.boostBranch}} + - uses: actions/checkout@v2 + with: + repository: boostorg/boost + ref: ${{matrix.boostBranch}} + submodules: true + path: boost-root + + - name: Install packages and setup env + run: | + sudo apt-get -o Acquire::Retries=$NET_RETRY_COUNT update + CXX=${{matrix.compiler}} + CXX="${CXX/gcc-/g++-}" + # Package names are g++-* and clang-*, so set this before correcting CXX for Clang + pkgs="$CXX xsltproc docbook-xsl docbook-xml lcov ccache" + sudo apt-get -o Acquire::Retries=$NET_RETRY_COUNT install -y $pkgs + CXX="ccache ${CXX/clang-/clang++-}" + echo "CXX=$CXX" >> $GITHUB_ENV + echo "CC=${{matrix.compiler}}" >> $GITHUB_ENV + if [[ "$CXX" =~ clang ]]; then + B2_TOOLSET=clang + else + B2_TOOLSET=gcc + fi + echo "B2_TOOLSET=$B2_TOOLSET" >> $GITHUB_ENV + echo "using $B2_TOOLSET : : $CXX ;" > ~/user-config.jam + + - name: Cache ccache + uses: hendrikmuhs/ccache-action@v1 + with: + key: ${{matrix.os}}-${{matrix.compiler}}-${{matrix.boostBranch}} + + - name: Prepare boost + working-directory: boost-root + run: ./bootstrap.sh && ./b2 headers + + - name: Boost build + working-directory: turtle + run: | + if [[ "${{matrix.boostBranch}}" == "master" ]]; then + B2_FLAGS="cxxstd=${{matrix.cxxstd}}" + else + B2_FLAGS="cxxflags=-std=c++${{matrix.cxxstd}}" + fi + if [[ "${{matrix.coverage}}" == "yes" ]]; then + B2_FLAGS="$B2_FLAGS cxxflags=--coverage linkflags=--coverage" + fi + scripts/build.sh --toolset=$B2_TOOLSET $B2_FLAGS -j3 + + - name: Collect coverage + if: matrix.coverage + working-directory: turtle + run: | + lcov -- version + lcov --gcov-tool=gcov-8 --directory "$PROJECT_DIR/test" --capture --output-file all.info + # dump a summary on the console + lcov --list all.info + lcov --extract all.info "$PROJECT_DIR/*" --output-file coverage.info + # ... erasing /test/ /doc/example/ folder data + lcov --remove coverage.info '*/test/*' '*/doc/example/*' -o coverage.info + # Output what was collected + lcov --list coverage.info + - name: Upload coverage + if: matrix.coverage + uses: coverallsapp/github-action@master + with: + path-to-lcov: ${{env.PROJECT_DIR}}/coverage.info + github-token: ${{secrets.GITHUB_TOKEN}} + + - name: Build required boost libs + working-directory: boost-root + run: ./b2 --toolset=$B2_TOOLSET --with-test --with-thread --with-chrono --with-system --with-atomic --with-date_time -j3 + + - name: CMake build + working-directory: turtle + run: | + mkdir build && cd build + CXX_STANDARD="${{matrix.cxxstd}}" + cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="-std=c++${CXX_STANDARD##*,}" -DCMAKE_CXX_COMPILER_LAUNCHER=ccache + cmake --build . --config Debug -- -j3 + ctest --output-on-failure --build-config Debug diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index a12eb457..00000000 --- a/.travis.yml +++ /dev/null @@ -1,85 +0,0 @@ -# Use, modification, and distribution are -# subject to the Boost Software License, Version 1.0. (See accompanying -# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -# -# Copyright Antony Polukhin 2014. -# Copyright Alexander Grund 2020. - -language: cpp - -branches: - only: - - master - -env: - - 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 - - gcc - -addons: - apt: - sources: - - ubuntu-toolchain-r-test - - llvm-toolchain-precise - packages: - - gcc-5 - - g++-5 - - clang-5.0 - - lld-5.0 - - xsltproc - - docbook-xsl - - docbook-xml - - python-yaml - - lcov - -before_install: - - DOCBOOK_XSL_DIR=/usr/share/xml/docbook/stylesheet/docbook-xsl - - DOCBOOK_DTD_DIR=/usr/share/xml/docbook/schema/dtd/4.2 - - - sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 60 --slave /usr/bin/g++ g++ /usr/bin/g++-5 - - gcc --version - - # Files, which coverage results must be ignored (files from other projects). Example: - IGNORE_COVERAGE='*/boost/progress.hpp */filesystem/src/path.cpp' - - IGNORE_COVERAGE='*/boost-local/*' - - # From this point and below code is same for all the Boost libs - # Cloning Boost libraries (fast nondeep cloning) - - PROJECT_DIR=`pwd` - - git --version - - BOOST_ROOT=$HOME/boost-local - - git clone -b $BRANCH_TO_TEST --depth 1 https://github.com/boostorg/boost.git $BOOST_ROOT - - cd $BOOST_ROOT - - git submodule update --init --depth 1 - - ./bootstrap.sh - - ./b2 headers - -script: - - cd $PROJECT_DIR - - export BOOST_ROOT - # `--coverage` flags required to generate coverage info for Coveralls - - scripts/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_ROOT && ./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 - - 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: - - cd $PROJECT_DIR - # Preparing Coveralls data by - # ... changing data format to a readable one - - 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 coverage.info - # Sending data to Coveralls - - gem install coveralls-lcov - - coveralls-lcov coverage.info diff --git a/appveyor.yml b/appveyor.yml index 7ebd82ee..40f4560a 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -14,7 +14,7 @@ branches: environment: matrix: - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 - BOOST: 1_60_0 + BOOST: 1_65_1 TOOLSET: msvc-14.0 - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 BOOST: 1_65_1 @@ -26,10 +26,10 @@ environment: CXX_STANDARD: 14 # CXX_STANDARD: 17 - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 - BOOST: 1_60_0 + BOOST: 1_65_1 CMAKE: true - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 - BOOST: 1_71_0 + BOOST: 1_77_0 CMAKE: true install: