|
| 1 | +name: POSIX |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + push: |
| 6 | + branches: |
| 7 | + - master |
| 8 | + - develop |
| 9 | + - feature/** |
| 10 | + |
| 11 | +env: |
| 12 | + UBSAN_OPTIONS: print_stacktrace=1 |
| 13 | + B2_VARIANT: debug,release |
| 14 | + B2_LINK: shared,static |
| 15 | + |
| 16 | +jobs: |
| 17 | + CI: |
| 18 | + strategy: |
| 19 | + fail-fast: false |
| 20 | + matrix: |
| 21 | + include: |
| 22 | + - { compiler: g++-4.4, cxxstd: '98,0x', os: ubuntu-16.04, install: yes } |
| 23 | + - { compiler: g++-5, cxxstd: '03,11,14', os: ubuntu-16.04, install: yes } |
| 24 | + - { compiler: g++-6, cxxstd: '03,11,14,17', os: ubuntu-16.04, install: yes } |
| 25 | + - { compiler: g++-7, cxxstd: '03,11,14,17', os: ubuntu-20.04, install: yes } |
| 26 | + - { compiler: g++-8, cxxstd: '03,11,14,17,2a', os: ubuntu-20.04, install: yes } |
| 27 | + - { compiler: g++-9, cxxstd: '03,11,14,17,2a', os: ubuntu-20.04, install: yes } |
| 28 | + - { compiler: g++-10, cxxstd: '03,11,14,17,2a', sanitize: yes, os: ubuntu-20.04, install: yes, linkflags: -fuse-ld=gold } |
| 29 | + - { compiler: clang++-3.5, cxxstd: '03,11', os: ubuntu-16.04, install: yes } |
| 30 | + - { compiler: clang++-6.0, cxxstd: '03,11', os: ubuntu-16.04, install: yes } |
| 31 | + - { compiler: clang++-7, cxxstd: '03,11', os: ubuntu-18.04, install: yes } |
| 32 | + - { compiler: clang++-8, cxxstd: '03,11,14', os: ubuntu-18.04, install: yes } |
| 33 | + - { compiler: clang++-9, cxxstd: '03,11,14', os: ubuntu-18.04, install: yes } |
| 34 | + - { compiler: clang++-10, cxxstd: '03,11,14,17,2a', sanitize: yes, os: ubuntu-20.04, install: yes } |
| 35 | + - { compiler: clang++-libc++, cxxstd: '03,11,14', os: ubuntu-18.04, install: 'libc++-dev libc++-helpers' } |
| 36 | + - { compiler: clang++, cxxstd: '03,11,14,1z', sanitize: yes, os: macos-10.15 } |
| 37 | + # Codecov |
| 38 | + - { compiler: g++-8, cxxstd: '03,11', coverage: yes, os: ubuntu-20.04, install: yes } |
| 39 | + |
| 40 | + runs-on: ${{matrix.os}} |
| 41 | + |
| 42 | + steps: |
| 43 | + - uses: actions/checkout@v2 |
| 44 | + |
| 45 | + - name: Install packages |
| 46 | + if: matrix.install |
| 47 | + run: | |
| 48 | + if [[ "${{matrix.install}}" == "yes" ]]; then |
| 49 | + pkgs="${{matrix.compiler}}" |
| 50 | + pkgs="${pkgs/clang++-/clang-}" |
| 51 | + else |
| 52 | + pkgs="${{matrix.install}}" |
| 53 | + fi |
| 54 | + sudo apt install $pkgs |
| 55 | +
|
| 56 | + - name: Setup config vars |
| 57 | + run: | |
| 58 | + echo "LIBRARY=${GITHUB_REPOSITORY#*/}" >> $GITHUB_ENV |
| 59 | + echo "B2_COMPILER=${{matrix.compiler}}" >> $GITHUB_ENV |
| 60 | + ${{matrix.compiler}} --version |
| 61 | + if [[ "${{matrix.compiler}}" =~ clang ]]; then |
| 62 | + B2_TOOLSET=clang |
| 63 | + elif [[ "${{matrix.compiler}}" =~ g\+\+ ]]; then |
| 64 | + B2_TOOLSET=gcc |
| 65 | + else |
| 66 | + echo "Unknown compiler: ${{matrix.compiler}}" >&2 |
| 67 | + false |
| 68 | + fi |
| 69 | + echo "using $B2_TOOLSET : : ${{matrix.compiler}} ;" > ~/user-config.jam |
| 70 | + echo "B2_TOOLSET=$B2_TOOLSET" >> $GITHUB_ENV |
| 71 | + echo "B2_CXXSTD=${{matrix.cxxstd}}" >> $GITHUB_ENV |
| 72 | + if [[ "${{matrix.sanitize}}" == "yes" ]]; then |
| 73 | + echo "B2_ASAN=address-sanitizer=norecover" >> $GITHUB_ENV |
| 74 | + echo "B2_UBSAN=undefined-sanitizer=norecover" >> $GITHUB_ENV |
| 75 | + fi |
| 76 | + [[ "${{matrix.linkflags}}" == "" ]] || echo "B2_LINKFLAGS=linkflags=${{matrix.linkflags}}" >> $GITHUB_ENV |
| 77 | +
|
| 78 | + - name: Setup Boost |
| 79 | + run: | |
| 80 | + REF=${GITHUB_BASE_REF:-$GITHUB_REF} |
| 81 | + BOOST_BRANCH=develop && [ "$REF" == "master" ] && BOOST_BRANCH=master || true |
| 82 | + cd .. |
| 83 | + git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root |
| 84 | + cd boost-root |
| 85 | + echo "BOOST_ROOT=$PWD" >> $GITHUB_ENV |
| 86 | + cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY |
| 87 | + git submodule update --init tools/boostdep |
| 88 | + python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" $LIBRARY |
| 89 | + ./bootstrap.sh |
| 90 | + ./b2 headers |
| 91 | +
|
| 92 | + - name: Setup coverage |
| 93 | + if: matrix.coverage |
| 94 | + run: .github/codecov.sh setup |
| 95 | + |
| 96 | + - name: Run tests |
| 97 | + working-directory: ${{env.BOOST_ROOT}} |
| 98 | + run: ./b2 -j3 libs/$LIBRARY/test toolset=$B2_TOOLSET cxxstd=$B2_CXXSTD variant=$B2_VARIANT link=$B2_LINK $B2_ASAN $B2_UBSAN $B2_LINKFLAGS $B2_FLAGS |
| 99 | + |
| 100 | + - name: Collect coverage |
| 101 | + if: matrix.coverage |
| 102 | + run: ${{github.workspace}}/.github/codecov.sh collect |
0 commit comments