-
-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
463 additions
and
195 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
#! /bin/bash | ||
# | ||
# Copyright 2017 - 2019 James E. King III | ||
# Distributed under 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) | ||
# | ||
# Bash script to run on Github Actions to perform codecov.io integration | ||
# | ||
|
||
# assumes an environment variable $LIBRARY set to the boost project name | ||
# and BOOST_ROOT to be set | ||
|
||
set -eux | ||
|
||
if [[ "$1" == "setup" ]]; then | ||
echo "B2_VARIANT=debug" >> "$GITHUB_ENV" | ||
echo "B2_FLAGS=cxxflags=--coverage linkflags=--coverage" >> "$GITHUB_ENV" | ||
else | ||
ver=7 # default | ||
if [ "${B2_COMPILER%%-*}" == "g++" ]; then | ||
if [[ "$B2_COMPILER" =~ g\+\+- ]]; then | ||
ver="${B2_COMPILER##*g++-}" | ||
fi | ||
fi | ||
GCOV=gcov-${ver} | ||
|
||
# install the latest lcov we know works | ||
rm -rf /tmp/lcov | ||
pushd /tmp | ||
git clone -b v1.14 https://github.com/linux-test-project/lcov.git | ||
export PATH=/tmp/lcov/bin:$PATH | ||
command -v lcov | ||
lcov --version | ||
popd | ||
|
||
# switch back to the original source code directory | ||
cd "$GITHUB_WORKSPACE" | ||
: "${LCOV_BRANCH_COVERAGE:=1}" # Set default | ||
|
||
lcov --gcov-tool="$GCOV" --rc lcov_branch_coverage=${LCOV_BRANCH_COVERAGE} --base-directory "$BOOST_ROOT/libs/$LIBRARY" --directory "$BOOST_ROOT" --capture --output-file all.info | ||
|
||
# all.info contains all the coverage info for all projects - limit to ours | ||
# first we extract the interesting headers for our project then we use that list to extract the right things | ||
for f in $(for f2 in include/boost/*; do echo "$f2"; done | cut -f2- -d/); do echo "*/$f*"; done > /tmp/interesting | ||
echo headers that matter: | ||
cat /tmp/interesting | ||
xargs -L 999999 -a /tmp/interesting lcov --gcov-tool="$GCOV" --rc lcov_branch_coverage=${LCOV_BRANCH_COVERAGE} --extract all.info {} "*/libs/$LIBRARY/src/*" --output-file coverage.info | ||
|
||
# dump a summary on the console - helps us identify problems in pathing | ||
lcov --gcov-tool="$GCOV" --rc lcov_branch_coverage=${LCOV_BRANCH_COVERAGE} --list coverage.info | ||
|
||
# upload to codecov.io | ||
curl -s https://codecov.io/bash > .codecov | ||
chmod +x .codecov | ||
./.codecov -f coverage.info -X gcov -x "$GCOV" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
name: POSIX | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- master | ||
- develop | ||
- feature/** | ||
|
||
env: | ||
UBSAN_OPTIONS: print_stacktrace=1 | ||
B2_VARIANT: debug,release | ||
B2_LINK: shared,static | ||
|
||
jobs: | ||
CI: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- { compiler: g++-4.4, cxxstd: '98,0x', os: ubuntu-16.04, install: yes } | ||
- { compiler: g++-5, cxxstd: '03,11,14', os: ubuntu-16.04, install: yes } | ||
- { compiler: g++-6, cxxstd: '03,11,14,17', os: ubuntu-16.04, install: yes } | ||
- { compiler: g++-7, cxxstd: '03,11,14,17', os: ubuntu-20.04, install: yes } | ||
- { compiler: g++-8, cxxstd: '03,11,14,17,2a', os: ubuntu-20.04, install: yes } | ||
- { compiler: g++-9, cxxstd: '03,11,14,17,2a', os: ubuntu-20.04, install: yes } | ||
- { compiler: g++-10, cxxstd: '03,11,14,17,2a', sanitize: yes, os: ubuntu-20.04, install: yes, linkflags: -fuse-ld=gold } | ||
- { compiler: clang++-3.5, cxxstd: '03,11', os: ubuntu-16.04, install: yes } | ||
- { compiler: clang++-6.0, cxxstd: '03,11', os: ubuntu-16.04, install: yes } | ||
- { compiler: clang++-7, cxxstd: '03,11', os: ubuntu-18.04, install: yes } | ||
- { compiler: clang++-8, cxxstd: '03,11,14', os: ubuntu-18.04, install: yes } | ||
- { compiler: clang++-9, cxxstd: '03,11,14', os: ubuntu-18.04, install: yes } | ||
- { compiler: clang++-10, cxxstd: '03,11,14,17,2a', sanitize: yes, os: ubuntu-20.04, install: yes } | ||
- { compiler: clang++-libc++, cxxstd: '03,11,14', os: ubuntu-18.04, install: 'libc++-dev libc++-helpers' } | ||
- { compiler: clang++, cxxstd: '03,11,14,1z', sanitize: yes, os: macos-10.15 } | ||
# Codecov | ||
- { compiler: g++-8, cxxstd: '03,11', coverage: yes, os: ubuntu-20.04, install: yes } | ||
|
||
runs-on: ${{matrix.os}} | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Install packages | ||
if: matrix.install | ||
run: | | ||
if [[ "${{matrix.install}}" == "yes" ]]; then | ||
pkgs="${{matrix.compiler}}" | ||
pkgs="${pkgs/clang++-/clang-}" | ||
else | ||
pkgs="${{matrix.install}}" | ||
fi | ||
sudo apt install $pkgs | ||
- name: Setup config vars | ||
run: | | ||
echo "LIBRARY=${GITHUB_REPOSITORY#*/}" >> $GITHUB_ENV | ||
echo "B2_COMPILER=${{matrix.compiler}}" >> $GITHUB_ENV | ||
${{matrix.compiler}} --version | ||
if [[ "${{matrix.compiler}}" =~ clang ]]; then | ||
B2_TOOLSET=clang | ||
elif [[ "${{matrix.compiler}}" =~ g\+\+ ]]; then | ||
B2_TOOLSET=gcc | ||
else | ||
echo "Unknown compiler: ${{matrix.compiler}}" >&2 | ||
false | ||
fi | ||
echo "using $B2_TOOLSET : : ${{matrix.compiler}} ;" > ~/user-config.jam | ||
echo "B2_TOOLSET=$B2_TOOLSET" >> $GITHUB_ENV | ||
echo "B2_CXXSTD=${{matrix.cxxstd}}" >> $GITHUB_ENV | ||
if [[ "${{matrix.sanitize}}" == "yes" ]]; then | ||
echo "B2_ASAN=address-sanitizer=norecover" >> $GITHUB_ENV | ||
echo "B2_UBSAN=undefined-sanitizer=norecover" >> $GITHUB_ENV | ||
fi | ||
[[ "${{matrix.linkflags}}" == "" ]] || echo "B2_LINKFLAGS=linkflags=${{matrix.linkflags}}" >> $GITHUB_ENV | ||
- name: Setup Boost | ||
run: | | ||
REF=${GITHUB_BASE_REF:-$GITHUB_REF} | ||
BOOST_BRANCH=develop && [ "$REF" == "master" ] && BOOST_BRANCH=master || true | ||
cd .. | ||
git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root | ||
cd boost-root | ||
echo "BOOST_ROOT=$PWD" >> $GITHUB_ENV | ||
cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY | ||
git submodule update --init tools/boostdep | ||
python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" $LIBRARY | ||
./bootstrap.sh | ||
./b2 headers | ||
- name: Setup coverage | ||
if: matrix.coverage | ||
run: .github/codecov.sh setup | ||
|
||
- name: Run tests | ||
working-directory: ${{env.BOOST_ROOT}} | ||
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 | ||
|
||
- name: Collect coverage | ||
if: matrix.coverage | ||
run: ${{github.workspace}}/.github/codecov.sh collect |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.