|
1 | | -name: GitHub Actions CI |
| 1 | +name: CI |
2 | 2 |
|
3 | 3 | on: |
4 | 4 | pull_request: |
@@ -64,3 +64,156 @@ jobs: |
64 | 64 | run: | |
65 | 65 | cd ../boost-root |
66 | 66 | ./b2 -j3 libs/$LIBRARY/test toolset=${{matrix.toolset}} cxxstd=${{matrix.cxxstd}} variant=debug,release |
| 67 | +
|
| 68 | + posix-cmake-subdir: |
| 69 | + strategy: |
| 70 | + fail-fast: false |
| 71 | + matrix: |
| 72 | + include: |
| 73 | + - os: ubuntu-latest |
| 74 | + - os: macos-latest |
| 75 | + |
| 76 | + runs-on: ${{matrix.os}} |
| 77 | + |
| 78 | + steps: |
| 79 | + - uses: actions/checkout@v4 |
| 80 | + |
| 81 | + - name: Install packages |
| 82 | + if: matrix.install |
| 83 | + run: sudo apt install ${{matrix.install}} |
| 84 | + |
| 85 | + - name: Setup Boost |
| 86 | + run: | |
| 87 | + echo GITHUB_REPOSITORY: $GITHUB_REPOSITORY |
| 88 | + LIBRARY=${GITHUB_REPOSITORY#*/} |
| 89 | + echo LIBRARY: $LIBRARY |
| 90 | + echo "LIBRARY=$LIBRARY" >> $GITHUB_ENV |
| 91 | + echo GITHUB_BASE_REF: $GITHUB_BASE_REF |
| 92 | + echo GITHUB_REF: $GITHUB_REF |
| 93 | + REF=${GITHUB_BASE_REF:-$GITHUB_REF} |
| 94 | + REF=${REF#refs/heads/} |
| 95 | + echo REF: $REF |
| 96 | + BOOST_BRANCH=develop && [ "$REF" == "master" ] && BOOST_BRANCH=master || true |
| 97 | + echo BOOST_BRANCH: $BOOST_BRANCH |
| 98 | + cd .. |
| 99 | + git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root |
| 100 | + cd boost-root |
| 101 | + cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY |
| 102 | + git submodule update --init tools/boostdep |
| 103 | + python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" $LIBRARY |
| 104 | +
|
| 105 | + - name: Use library with add_subdirectory |
| 106 | + run: | |
| 107 | + cd ../boost-root/libs/$LIBRARY/test/cmake_subdir_test |
| 108 | + mkdir __build__ && cd __build__ |
| 109 | + cmake .. |
| 110 | + cmake --build . |
| 111 | + ctest --output-on-failure --no-tests=error |
| 112 | +
|
| 113 | + posix-cmake-install: |
| 114 | + strategy: |
| 115 | + fail-fast: false |
| 116 | + matrix: |
| 117 | + include: |
| 118 | + - os: ubuntu-latest |
| 119 | + - os: macos-latest |
| 120 | + |
| 121 | + runs-on: ${{matrix.os}} |
| 122 | + |
| 123 | + steps: |
| 124 | + - uses: actions/checkout@v4 |
| 125 | + |
| 126 | + - name: Install packages |
| 127 | + if: matrix.install |
| 128 | + run: sudo apt install ${{matrix.install}} |
| 129 | + |
| 130 | + - name: Setup Boost |
| 131 | + run: | |
| 132 | + echo GITHUB_REPOSITORY: $GITHUB_REPOSITORY |
| 133 | + LIBRARY=${GITHUB_REPOSITORY#*/} |
| 134 | + echo LIBRARY: $LIBRARY |
| 135 | + echo "LIBRARY=$LIBRARY" >> $GITHUB_ENV |
| 136 | + echo GITHUB_BASE_REF: $GITHUB_BASE_REF |
| 137 | + echo GITHUB_REF: $GITHUB_REF |
| 138 | + REF=${GITHUB_BASE_REF:-$GITHUB_REF} |
| 139 | + REF=${REF#refs/heads/} |
| 140 | + echo REF: $REF |
| 141 | + BOOST_BRANCH=develop && [ "$REF" == "master" ] && BOOST_BRANCH=master || true |
| 142 | + echo BOOST_BRANCH: $BOOST_BRANCH |
| 143 | + cd .. |
| 144 | + git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root |
| 145 | + cd boost-root |
| 146 | + cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY |
| 147 | + git submodule update --init tools/boostdep |
| 148 | + python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" $LIBRARY |
| 149 | +
|
| 150 | + - name: Configure |
| 151 | + run: | |
| 152 | + cd ../boost-root |
| 153 | + mkdir __build__ && cd __build__ |
| 154 | + cmake -DBOOST_INCLUDE_LIBRARIES=$LIBRARY -DCMAKE_INSTALL_PREFIX=~/.local .. |
| 155 | +
|
| 156 | + - name: Install |
| 157 | + run: | |
| 158 | + cd ../boost-root/__build__ |
| 159 | + cmake --build . --target install |
| 160 | +
|
| 161 | + - name: Use the installed library |
| 162 | + run: | |
| 163 | + cd ../boost-root/libs/$LIBRARY/test/cmake_install_test && mkdir __build__ && cd __build__ |
| 164 | + cmake -DCMAKE_INSTALL_PREFIX=~/.local .. |
| 165 | + cmake --build . |
| 166 | + ctest --output-on-failure --no-tests=error |
| 167 | +
|
| 168 | + posix-cmake-test: |
| 169 | + strategy: |
| 170 | + fail-fast: false |
| 171 | + matrix: |
| 172 | + include: |
| 173 | + - os: ubuntu-latest |
| 174 | + - os: macos-latest |
| 175 | + |
| 176 | + runs-on: ${{matrix.os}} |
| 177 | + |
| 178 | + steps: |
| 179 | + - uses: actions/checkout@v4 |
| 180 | + |
| 181 | + - name: Install packages |
| 182 | + if: matrix.install |
| 183 | + run: sudo apt install ${{matrix.install}} |
| 184 | + |
| 185 | + - name: Setup Boost |
| 186 | + run: | |
| 187 | + echo GITHUB_REPOSITORY: $GITHUB_REPOSITORY |
| 188 | + LIBRARY=${GITHUB_REPOSITORY#*/} |
| 189 | + echo LIBRARY: $LIBRARY |
| 190 | + echo "LIBRARY=$LIBRARY" >> $GITHUB_ENV |
| 191 | + echo GITHUB_BASE_REF: $GITHUB_BASE_REF |
| 192 | + echo GITHUB_REF: $GITHUB_REF |
| 193 | + REF=${GITHUB_BASE_REF:-$GITHUB_REF} |
| 194 | + REF=${REF#refs/heads/} |
| 195 | + echo REF: $REF |
| 196 | + BOOST_BRANCH=develop && [ "$REF" == "master" ] && BOOST_BRANCH=master || true |
| 197 | + echo BOOST_BRANCH: $BOOST_BRANCH |
| 198 | + cd .. |
| 199 | + git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root |
| 200 | + cd boost-root |
| 201 | + cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY |
| 202 | + git submodule update --init tools/boostdep |
| 203 | + python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" $LIBRARY |
| 204 | +
|
| 205 | + - name: Configure |
| 206 | + run: | |
| 207 | + cd ../boost-root |
| 208 | + mkdir __build__ && cd __build__ |
| 209 | + cmake -DBOOST_INCLUDE_LIBRARIES=$LIBRARY -DBUILD_TESTING=ON .. |
| 210 | +
|
| 211 | + - name: Build tests |
| 212 | + run: | |
| 213 | + cd ../boost-root/__build__ |
| 214 | + cmake --build . --target tests |
| 215 | +
|
| 216 | + - name: Run tests |
| 217 | + run: | |
| 218 | + cd ../boost-root/__build__ |
| 219 | + ctest --output-on-failure --no-tests=error |
0 commit comments