|
| 1 | +############################################################################## |
| 2 | +# GitHub Actions Workflow for Boost.Geometry to build tests with cmake |
| 3 | +# |
| 4 | +# Copyright (c) 2024 Oracle and/or its affiliates. |
| 5 | +# Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle |
| 6 | +# |
| 7 | +# Use, modification and distribution is subject to the Boost Software License, |
| 8 | +# Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at |
| 9 | +# http://www.boost.org/LICENSE_1_0.txt) |
| 10 | +############################################################################## |
| 11 | +name: cmake |
| 12 | + |
| 13 | +on: [push] |
| 14 | + |
| 15 | +jobs: |
| 16 | + ############################################################################## |
| 17 | + clang: |
| 18 | + name: ${{ matrix.b2_toolset }} |
| 19 | + runs-on: ${{ matrix.os }} |
| 20 | + |
| 21 | + strategy: |
| 22 | + fail-fast: false |
| 23 | + matrix: |
| 24 | + b2_toolset: [ |
| 25 | + clang-14 |
| 26 | + ] |
| 27 | + |
| 28 | + include: |
| 29 | + - b2_toolset: clang-14 |
| 30 | + b2_cxxstd: 14,17,2a |
| 31 | + version: "14" |
| 32 | + os: ubuntu-22.04 |
| 33 | + steps: |
| 34 | + - name: Set up environment |
| 35 | + id: setenv |
| 36 | + run: | |
| 37 | + if [[ "$GITHUB_REF" == *master ]]; then |
| 38 | + echo "BOOST_BRANCH=master" >> $GITHUB_ENV |
| 39 | + else |
| 40 | + echo "BOOST_BRANCH=develop" >> $GITHUB_ENV |
| 41 | + fi |
| 42 | + echo "BOOST_SELF=$(basename $GITHUB_WORKSPACE)" >> $GITHUB_ENV |
| 43 | + echo "BOOST_ROOT=$GITHUB_WORKSPACE/boost-root" >> $GITHUB_ENV |
| 44 | + echo "boost_self=$(basename $GITHUB_WORKSPACE)" >> "$GITHUB_OUTPUT" |
| 45 | + echo "boost_root=$GITHUB_WORKSPACE/boost-root" >> "$GITHUB_OUTPUT" |
| 46 | +
|
| 47 | + - name: Clone boostorg/boost |
| 48 | + run: | |
| 49 | + git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git $BOOST_ROOT |
| 50 | + cd $BOOST_ROOT |
| 51 | + git submodule update -q --init libs/headers |
| 52 | + git submodule update -q --init tools/boost_install |
| 53 | + git submodule update -q --init tools/boostdep |
| 54 | + git submodule update -q --init tools/build |
| 55 | + mkdir -p libs/$BOOST_SELF |
| 56 | +
|
| 57 | + - uses: actions/checkout@v2 |
| 58 | + with: |
| 59 | + path: ${{ steps.setenv.outputs.boost_root }}/libs/${{ steps.setenv.outputs.boost_self }} |
| 60 | + |
| 61 | + - name: Run tools/boostdep/depinst/depinst.py |
| 62 | + run: | |
| 63 | + cd $BOOST_ROOT |
| 64 | + python tools/boostdep/depinst/depinst.py --include benchmark --include example --include examples --include tools $BOOST_SELF |
| 65 | +
|
| 66 | + - name: Bootstrap boostorg/boost |
| 67 | + run: | |
| 68 | + gcc --version |
| 69 | + cd $BOOST_ROOT |
| 70 | + ./bootstrap.sh --with-toolset=gcc |
| 71 | + ./b2 headers |
| 72 | + test -f /usr/local/bin/b2 && rm -rf /usr/local/bin/b2 |
| 73 | + test -f /usr/local/bin/bjam && rm -rf /usr/local/bin/bjam |
| 74 | + sudo cp $BOOST_ROOT/b2 /usr/local/bin/ |
| 75 | + ls -l /usr/local/bin/b2 |
| 76 | + b2 -v |
| 77 | +
|
| 78 | + - name: Set up clang toolset in ~/user-config.jam |
| 79 | + run: | |
| 80 | + export CXX_NAME=clang++-${{ matrix.version }} |
| 81 | + echo ${CXX_NAME} |
| 82 | + echo "# $HOME/user-config.jam" > $HOME/user-config.jam |
| 83 | + echo "using clang : : $(which clang++-${{ matrix.version }}) ;" > ${HOME}/user-config.jam |
| 84 | + test -f $HOME/user-config.jam && cat $HOME/user-config.jam |
| 85 | +
|
| 86 | + - name: Build tests with cmake (c++17) |
| 87 | + run: | |
| 88 | + cd $BOOST_ROOT/libs/geometry |
| 89 | + mkdir __build |
| 90 | + cd __build |
| 91 | + cmake -DCMAKE_CXX_STANDARD=17 -DBUILD_TESTING=ON .. |
| 92 | + cmake --build . --target tests |
| 93 | +
|
| 94 | + - name: Build tests with cmake |
| 95 | + run: | |
| 96 | + cd $BOOST_ROOT/libs/geometry/__build |
| 97 | + rm -rf * |
| 98 | + cmake -DBUILD_TESTING=ON .. |
| 99 | + cmake --build . --target tests |
| 100 | +
|
| 101 | + - name: Run tests |
| 102 | + run: | |
| 103 | + cd $BOOST_ROOT/libs/geometry/__build |
| 104 | + ctest --output-on-failure --no-tests=error |
0 commit comments