1name: GitHub Actions CI 2 3on: 4 pull_request: 5 push: 6 branches: 7 - master 8 - develop 9 - githubactions* 10 - feature/** 11 - fix/** 12 - pr/** 13 14env: 15 PROJECT: libs/spirit 16 17jobs: 18 posix: 19 strategy: 20 fail-fast: false 21 matrix: 22 include: 23 - name: "STD=14 JOB=test/x3 Job 0" 24 buildtype: "boost" 25 packages: "clang-10 libc++-10-dev libc++abi-10-dev jq ccache" 26 packages_to_remove: "" 27 os: "ubuntu-18.04" 28 cxx: "clang-10" 29 sources: "" 30 llvm_os: "bionic" 31 llvm_ver: "10" 32 std: "14" 33 job: "test/x3" 34 travis_compiler: "clang-10" 35 - name: "STD=14 JOB=test/x3 Job 1" 36 buildtype: "boost" 37 packages: "g++-10 jq ccache" 38 packages_to_remove: "" 39 os: "ubuntu-18.04" 40 cxx: "gcc-10" 41 sources: "" 42 llvm_os: "" 43 llvm_ver: "" 44 std: "14" 45 job: "test/x3" 46 travis_compiler: "gcc-10" 47 - name: "STD=11 JOB=test/qi Job 2" 48 buildtype: "boost" 49 packages: "clang-10 libc++-10-dev libc++abi-10-dev jq ccache" 50 packages_to_remove: "" 51 os: "ubuntu-18.04" 52 cxx: "clang-10" 53 sources: "" 54 llvm_os: "bionic" 55 llvm_ver: "10" 56 std: "11" 57 job: "test/qi" 58 travis_compiler: "clang-10" 59 - name: "STD=11 JOB=test/karma Job 3" 60 buildtype: "boost" 61 packages: "clang-10 libc++-10-dev libc++abi-10-dev jq ccache" 62 packages_to_remove: "" 63 os: "ubuntu-18.04" 64 cxx: "clang-10" 65 sources: "" 66 llvm_os: "bionic" 67 llvm_ver: "10" 68 std: "11" 69 job: "test/karma" 70 travis_compiler: "clang-10" 71 - name: "STD=11 JOB=test/lex Job 4" 72 buildtype: "boost" 73 packages: "clang-10 libc++-10-dev libc++abi-10-dev jq ccache" 74 packages_to_remove: "" 75 os: "ubuntu-18.04" 76 cxx: "clang-10" 77 sources: "" 78 llvm_os: "bionic" 79 llvm_ver: "10" 80 std: "11" 81 job: "test/lex" 82 travis_compiler: "clang-10" 83 - name: "STD=11 JOB=test/support Job 5" 84 buildtype: "boost" 85 packages: "clang-10 libc++-10-dev libc++abi-10-dev jq ccache" 86 packages_to_remove: "" 87 os: "ubuntu-18.04" 88 cxx: "clang-10" 89 sources: "" 90 llvm_os: "bionic" 91 llvm_ver: "10" 92 std: "11" 93 job: "test/support" 94 travis_compiler: "clang-10" 95 - name: "STD=11 JOB=repository/test Job 6" 96 buildtype: "boost" 97 packages: "clang-10 libc++-10-dev libc++abi-10-dev jq ccache" 98 packages_to_remove: "" 99 os: "ubuntu-18.04" 100 cxx: "clang-10" 101 sources: "" 102 llvm_os: "bionic" 103 llvm_ver: "10" 104 std: "11" 105 job: "repository/test" 106 travis_compiler: "clang-10" 107 - name: "STD=03 JOB=test/qi Job 7" 108 buildtype: "boost" 109 packages: "clang-10 libc++-10-dev libc++abi-10-dev jq ccache" 110 packages_to_remove: "" 111 os: "ubuntu-18.04" 112 cxx: "clang-10" 113 sources: "" 114 llvm_os: "bionic" 115 llvm_ver: "10" 116 std: "03" 117 job: "test/qi" 118 travis_compiler: "clang-10" 119 - name: "STD=03 JOB=test/karma Job 8" 120 buildtype: "boost" 121 packages: "clang-10 libc++-10-dev libc++abi-10-dev jq ccache" 122 packages_to_remove: "" 123 os: "ubuntu-18.04" 124 cxx: "clang-10" 125 sources: "" 126 llvm_os: "bionic" 127 llvm_ver: "10" 128 std: "03" 129 job: "test/karma" 130 travis_compiler: "clang-10" 131 - name: "STD=03 JOB=test/lex Job 9" 132 buildtype: "boost" 133 packages: "clang-10 libc++-10-dev libc++abi-10-dev jq ccache" 134 packages_to_remove: "" 135 os: "ubuntu-18.04" 136 cxx: "clang-10" 137 sources: "" 138 llvm_os: "bionic" 139 llvm_ver: "10" 140 std: "03" 141 job: "test/lex" 142 travis_compiler: "clang-10" 143 - name: "STD=03 JOB=test/support Job 10" 144 buildtype: "boost" 145 packages: "clang-10 libc++-10-dev libc++abi-10-dev jq ccache" 146 packages_to_remove: "" 147 os: "ubuntu-18.04" 148 cxx: "clang-10" 149 sources: "" 150 llvm_os: "bionic" 151 llvm_ver: "10" 152 std: "03" 153 job: "test/support" 154 travis_compiler: "clang-10" 155 - name: "STD=03 JOB=repository/test Job 11" 156 buildtype: "boost" 157 packages: "clang-10 libc++-10-dev libc++abi-10-dev jq ccache" 158 packages_to_remove: "" 159 os: "ubuntu-18.04" 160 cxx: "clang-10" 161 sources: "" 162 llvm_os: "bionic" 163 llvm_ver: "10" 164 std: "03" 165 job: "repository/test" 166 travis_compiler: "clang-10" 167 - name: "STD=11 JOB=test/qi Job 12" 168 buildtype: "boost" 169 packages: "g++-10 jq ccache" 170 packages_to_remove: "" 171 os: "ubuntu-18.04" 172 cxx: "gcc-10" 173 sources: "" 174 llvm_os: "" 175 llvm_ver: "" 176 std: "11" 177 job: "test/qi" 178 travis_compiler: "gcc-10" 179 - name: "STD=11 JOB=test/karma Job 13" 180 buildtype: "boost" 181 packages: "g++-10 jq ccache" 182 packages_to_remove: "" 183 os: "ubuntu-18.04" 184 cxx: "gcc-10" 185 sources: "" 186 llvm_os: "" 187 llvm_ver: "" 188 std: "11" 189 job: "test/karma" 190 travis_compiler: "gcc-10" 191 - name: "STD=11 JOB=test/lex Job 14" 192 buildtype: "boost" 193 packages: "g++-10 jq ccache" 194 packages_to_remove: "" 195 os: "ubuntu-18.04" 196 cxx: "gcc-10" 197 sources: "" 198 llvm_os: "" 199 llvm_ver: "" 200 std: "11" 201 job: "test/lex" 202 travis_compiler: "gcc-10" 203 - name: "STD=11 JOB=test/support Job 15" 204 buildtype: "boost" 205 packages: "g++-10 jq ccache" 206 packages_to_remove: "" 207 os: "ubuntu-18.04" 208 cxx: "gcc-10" 209 sources: "" 210 llvm_os: "" 211 llvm_ver: "" 212 std: "11" 213 job: "test/support" 214 travis_compiler: "gcc-10" 215 - name: "STD=11 JOB=repository/test Job 16" 216 buildtype: "boost" 217 packages: "g++-10 jq ccache" 218 packages_to_remove: "" 219 os: "ubuntu-18.04" 220 cxx: "gcc-10" 221 sources: "" 222 llvm_os: "" 223 llvm_ver: "" 224 std: "11" 225 job: "repository/test" 226 travis_compiler: "gcc-10" 227 - name: "STD=03 JOB=test/qi Job 17" 228 buildtype: "boost" 229 packages: "g++-10 jq ccache" 230 packages_to_remove: "" 231 os: "ubuntu-18.04" 232 cxx: "gcc-10" 233 sources: "" 234 llvm_os: "" 235 llvm_ver: "" 236 std: "03" 237 job: "test/qi" 238 travis_compiler: "gcc-10" 239 - name: "STD=03 JOB=test/karma Job 18" 240 buildtype: "boost" 241 packages: "g++-10 jq ccache" 242 packages_to_remove: "" 243 os: "ubuntu-18.04" 244 cxx: "gcc-10" 245 sources: "" 246 llvm_os: "" 247 llvm_ver: "" 248 std: "03" 249 job: "test/karma" 250 travis_compiler: "gcc-10" 251 - name: "STD=03 JOB=test/lex Job 19" 252 buildtype: "boost" 253 packages: "g++-10 jq ccache" 254 packages_to_remove: "" 255 os: "ubuntu-18.04" 256 cxx: "gcc-10" 257 sources: "" 258 llvm_os: "" 259 llvm_ver: "" 260 std: "03" 261 job: "test/lex" 262 travis_compiler: "gcc-10" 263 - name: "STD=03 JOB=test/support Job 20" 264 buildtype: "boost" 265 packages: "g++-10 jq ccache" 266 packages_to_remove: "" 267 os: "ubuntu-18.04" 268 cxx: "gcc-10" 269 sources: "" 270 llvm_os: "" 271 llvm_ver: "" 272 std: "03" 273 job: "test/support" 274 travis_compiler: "gcc-10" 275 - name: "STD=03 JOB=repository/test Job 21" 276 buildtype: "boost" 277 packages: "g++-10 jq ccache" 278 packages_to_remove: "" 279 os: "ubuntu-18.04" 280 cxx: "gcc-10" 281 sources: "" 282 llvm_os: "" 283 llvm_ver: "" 284 std: "03" 285 job: "repository/test" 286 travis_compiler: "gcc-10" 287 - name: "STD=03 JOB=classic/test Job 22" 288 buildtype: "boost" 289 packages: "clang-10 libc++-10-dev libc++abi-10-dev jq ccache" 290 packages_to_remove: "" 291 os: "ubuntu-18.04" 292 cxx: "clang-10" 293 sources: "" 294 llvm_os: "bionic" 295 llvm_ver: "10" 296 std: "03" 297 job: "classic/test" 298 travis_compiler: "clang-10" 299 - name: "STD=03 JOB=classic/test Job 23" 300 buildtype: "boost" 301 packages: "g++-10 jq ccache" 302 packages_to_remove: "" 303 os: "ubuntu-18.04" 304 cxx: "gcc-10" 305 sources: "" 306 llvm_os: "" 307 llvm_ver: "" 308 std: "03" 309 job: "classic/test" 310 travis_compiler: "gcc-10" 311 312 runs-on: ${{ matrix.os }} 313 container: ${{ matrix.container }} 314 315 steps: 316 - name: Check if running in container 317 if: matrix.container != '' 318 run: echo "GHA_CONTAINER=${{ matrix.container }}" >> $GITHUB_ENV 319 320 - uses: actions/checkout@v2 321 322 - name: linux 323 shell: bash 324 env: 325 CXX: ${{ matrix.cxx }} 326 SOURCES: ${{ matrix.sources }} 327 LLVM_OS: ${{ matrix.llvm_os }} 328 LLVM_VER: ${{ matrix.llvm_ver }} 329 PACKAGES: ${{ matrix.packages }} 330 PACKAGES_TO_REMOVE: ${{ matrix.packages_to_remove }} 331 JOB_BUILDTYPE: ${{ matrix.buildtype }} 332 STD: ${{ matrix.std }} 333 JOB: ${{ matrix.job }} 334 TRAVIS_COMPILER: ${{ matrix.travis_compiler }} 335 TRAVIS_BRANCH: ${{ github.base_ref }} 336 TRAVIS_OS_NAME: "linux" 337 run: | 338 echo '==================================> SETUP' 339 echo '==================================> PACKAGES' 340 set -e 341 if [ -n "$PACKAGES_TO_REMOVE" ]; then sudo apt-get purge -y $PACKAGES_TO_REMOVE; fi 342 echo ">>>>> APT: REPO.." 343 for i in {1..3}; do sudo -E apt-add-repository -y "ppa:ubuntu-toolchain-r/test" && break || sleep 2; done 344 345 if test -n "${LLVM_OS}" ; then 346 wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - 347 if test -n "${LLVM_VER}" ; then 348 sudo -E apt-add-repository "deb http://apt.llvm.org/${LLVM_OS}/ llvm-toolchain-${LLVM_OS}-${LLVM_VER} main" 349 else 350 # Snapshot (i.e. trunk) build of clang 351 sudo -E apt-add-repository "deb http://apt.llvm.org/${LLVM_OS}/ llvm-toolchain-${LLVM_OS} main" 352 fi 353 fi 354 echo ">>>>> APT: UPDATE.." 355 sudo -E apt-get -o Acquire::Retries=3 update 356 if test -n "${SOURCES}" ; then 357 echo ">>>>> APT: INSTALL SOURCES.." 358 for SOURCE in $SOURCES; do 359 sudo -E apt-add-repository ppa:$SOURCE 360 done 361 fi 362 echo ">>>>> APT: INSTALL ${PACKAGES}.." 363 sudo -E DEBIAN_FRONTEND=noninteractive apt-get -o Acquire::Retries=3 -y --no-install-suggests --no-install-recommends install ${PACKAGES} 364 365 echo '==================================> INSTALL AND COMPILE' 366 set -e 367 export TRAVIS_BUILD_DIR=$(pwd) 368 export TRAVIS_BRANCH=${TRAVIS_BRANCH:-$(echo $GITHUB_REF | awk 'BEGIN { FS = "/" } ; { print $3 }')} 369 export VCS_COMMIT_ID=$GITHUB_SHA 370 export GIT_COMMIT=$GITHUB_SHA 371 export REPO_NAME=$(basename $GITHUB_REPOSITORY) 372 export USER=$(whoami) 373 export CC=${CC:-gcc} 374 export PATH=~/.local/bin:/usr/local/bin:$PATH 375 export BOOST_ROOT="$HOME/boost" 376 export BOOST_BUILD_PATH="$HOME/build-boost" 377 export GITHUB_EVENT_NUMBER=${{ github.event.number }} 378 export TRAVIS_PULL_REQUEST=${GITHUB_EVENT_NUMBER:-false} 379 export TRAVIS_REPO_SLUG=$REPO_NAME 380 381 382 if [ "$JOB_BUILDTYPE" == "boost" ]; then 383 384 echo '==================================> INSTALL' 385 386 export CACHE_NAME=$TRAVIS_OS_NAME-$TOOLSET-$STD-$JOB 387 export PATH=$BOOST_ROOT:$PATH 388 if [[ "$TRAVIS_COMPILER" =~ ^clang- ]]; then export STDLIB=stdlib=libc++ ; fi 389 # Creating ~/user-config.jam file 390 sed 's/^ //' > ~/user-config.jam << 'EOF' 391 392 import feature ; 393 import os ; 394 import regex ; 395 import toolset ; 396 397 398 local TOOLSET = [ os.environ TRAVIS_COMPILER ] ; 399 local toolset-parts = [ regex.split $(TOOLSET) "-" ] ; 400 local toolset-name = $(toolset-parts[1]) ; 401 local toolset-feature = $(toolset-parts[2-]:J="-") ; 402 403 local cxx ; 404 switch $(toolset-name) { 405 case gcc : cxx ?= [ regex.replace $(TOOLSET) "gcc" "g++" ] ; 406 case clang : cxx ?= [ regex.replace $(TOOLSET) "clang" "clang++" ] ; 407 case * : EXIT "user-config: Unsupported toolset $(toolset-name)" ; 408 } 409 410 using $(toolset-name) : $(toolset-feature) : ccache $(cxx) ; 411 412 # Release variant with enabled asserts 413 variant sanitize : <optimization>speed <debug-symbols>off <inlining>full 414 <runtime-debugging>off ; 415 416 # Ignore some warnings 417 feature.feature known-warnings : suppress : optional incidental propagated ; 418 toolset.flags gcc.compile OPTIONS <known-warnings>suppress : 419 -Wno-maybe-uninitialized # this warning is known to give false positives 420 # -Wextra warnings: 421 -Wno-deprecated-copy # Proto, Phoenix, GCC bug 92145 422 : unchecked ; 423 toolset.flags clang-linux.compile OPTIONS <known-warnings>suppress : 424 -Wno-deprecated-copy # Proto, Phoenix 425 : unchecked ; 426 427 EOF 428 # Determining the root branch 429 if [[ "$TRAVIS_PULL_REQUEST" == "false" ]]; then 430 export BRANCH=$TRAVIS_BRANCH 431 else 432 # It is a pull request. Retrieve the base branch from GitHub 433 GH_PR_API=https://api.github.com/repos/$TRAVIS_REPO_SLUG/pulls/$TRAVIS_PULL_REQUEST 434 export BRANCH=`curl -s $GH_PR_API | jq -r .head.ref`; 435 fi 436 if [[ ! "$BRANCH" =~ ^(master|develop)$ ]]; then 437 # Travis has been triggered not from our main branches. 438 # Find out the base branch from the git history 439 # TODO: Not implemented yet, but in most cases it will be develop branch 440 export BRANCH=develop 441 fi 442 echo Root branch is $BRANCH 443 444 env 445 sed 's/--depth=1/--depth=9/g' `which git` > ~/git && chmod +x ~/git 446 ~/git clone -j10 --branch=$BRANCH --depth=1 --quiet --recurse-submodules=":(exclude)$PROJECT" --shallow-submodules https://github.com/boostorg/boost.git $BOOST_ROOT 447 pushd $BOOST_ROOT 448 rm -rf $PROJECT 449 ./bootstrap.sh --with-toolset=clang 450 ./b2 headers 451 cp -rp $TRAVIS_BUILD_DIR $PROJECT 452 ln -s $PROJECT $TRAVIS_BUILD_DIR 453 cd $PROJECT 454 cd $JOB 455 456 echo '==================================> SCRIPT' 457 458 b2 link=shared threading=multi variant=release,sanitize toolset=$TRAVIS_COMPILER cxxstd=$STD $STDLIB warnings=extra known-warnings=suppress warnings-as-errors=on 459 460 fi 461