mirror of
https://github.com/boostorg/conversion.git
synced 2026-01-19 04:02:18 +00:00
181 lines
8.0 KiB
YAML
181 lines
8.0 KiB
YAML
name: GitHub Actions CI
|
|
|
|
on:
|
|
pull_request:
|
|
push:
|
|
branches:
|
|
- master
|
|
- develop
|
|
- githubactions*
|
|
- feature/**
|
|
- fix/**
|
|
- pr/**
|
|
|
|
jobs:
|
|
posix:
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- name: "GCC-8"
|
|
buildtype: "boost"
|
|
packages: "g++-8"
|
|
packages_to_remove: ""
|
|
os: "ubuntu-16.04"
|
|
llvm_os: ""
|
|
llvm_ver: ""
|
|
b2_args: "cxxstd=98,03,11,14,1z toolset=gcc-8 cxxflags=\"--coverage -fsanitize=address,leak,undefined -fno-sanitize-recover=undefined -DBOOST_TRAVISCI_BUILD\" linkflags=\"--coverage -lasan -lubsan\""
|
|
gcovtool: "gcov-8"
|
|
- name: "GCC-4.6"
|
|
buildtype: "boost"
|
|
packages: "g++-4.6"
|
|
packages_to_remove: ""
|
|
os: "ubuntu-16.04"
|
|
llvm_os: ""
|
|
llvm_ver: ""
|
|
b2_args: "cxxstd=98,0x toolset=gcc-4.6 cxxflags=\"--coverage -DBOOST_TRAVISCI_BUILD\" linkflags=\"--coverage\""
|
|
gcovtool: "gcov-4.6"
|
|
- name: "Clang-7"
|
|
buildtype: "boost"
|
|
packages: "clang++-7 llvm-7"
|
|
packages_to_remove: ""
|
|
os: "ubuntu-16.04"
|
|
llvm_os: "xenial"
|
|
llvm_ver: "7"
|
|
b2_args: "cxxstd=98,03,11,14,1z toolset=clang-7 cxxflags=\"--coverage -fsanitize=address,leak,undefined -fno-sanitize-recover=undefined -DBOOST_TRAVISCI_BUILD\" linkflags=\"--coverage -fsanitize=address,leak,undefined\""
|
|
gcovtool: "gcov_for_clang.sh"
|
|
- name: "Clang-3.8, libc++"
|
|
buildtype: "boost"
|
|
packages: "libc++-dev llvm-3.8"
|
|
packages_to_remove: ""
|
|
os: "ubuntu-16.04"
|
|
llvm_os: ""
|
|
llvm_ver: "3.8"
|
|
b2_args: "cxxstd=03,11,14 toolset=clang-libc++ cxxflags=\"--coverage -fsanitize=address,leak,undefined -fno-sanitize-recover=undefined -DBOOST_TRAVISCI_BUILD\" linkflags=\"--coverage -fsanitize=address,leak,undefined\""
|
|
gcovtool: "gcov_for_clang.sh"
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
container: ${{ matrix.container }}
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: Check if running in container
|
|
if: matrix.container != ''
|
|
run: echo "GHA_CONTAINER=${{ matrix.container }}" >> $GITHUB_ENV
|
|
|
|
- name: Install packages
|
|
shell: bash
|
|
env:
|
|
CI_LLVM_OS: ${{ matrix.llvm_os }}
|
|
CI_LLVM_VER: ${{ matrix.llvm_ver }}
|
|
CI_PACKAGES: ${{ matrix.packages }}
|
|
CI_PACKAGES_TO_REMOVE: ${{ matrix.packages_to_remove }}
|
|
run: |
|
|
set -ex
|
|
|
|
ci_print_packages_info() {
|
|
if [ -n "$CI_DEBUG" ]; then
|
|
echo $1
|
|
whoami
|
|
dpkg -l
|
|
echo "Checking /usr/local"
|
|
ls -al /usr/local
|
|
echo "Checking clang"
|
|
which clang++ || true
|
|
clang++ --version || true
|
|
ls -al /etc/alternatives
|
|
ls -al /usr/bin/c*
|
|
fi
|
|
}
|
|
|
|
ci_remove_packages() {
|
|
if [ -n "$CI_PACKAGES_TO_REMOVE" ]; then
|
|
echo "About to run sudo apt-get purge -y $CI_PACKAGES_TO_REMOVE"
|
|
sudo apt-get purge -y $CI_PACKAGES_TO_REMOVE
|
|
fi
|
|
}
|
|
|
|
ci_linux_cxx_install() {
|
|
echo "About to run linux-cxx-install.sh"
|
|
wget https://raw.githubusercontent.com/boostorg/boost-ci/master/ci/drone/linux-cxx-install.sh
|
|
chmod +x linux-cxx-install.sh
|
|
mv linux-cxx-install.sh .github/
|
|
PACKAGES=$CI_PACKAGES LLVM_OS=$CI_LLVM_OS LLVM_VER=$CI_LLVM_VER .github/linux-cxx-install.sh
|
|
echo "Done with linux-cxx-install.sh"
|
|
}
|
|
|
|
ci_print_packages_info "Before package removal or install"
|
|
ci_remove_packages
|
|
ci_linux_cxx_install
|
|
ci_print_packages_info "After package removal and install"
|
|
|
|
- name: Prepare Boost libraries and Test
|
|
shell: bash
|
|
env:
|
|
CI_LLVM_VER: ${{ matrix.llvm_ver }}
|
|
CI_B2_ARGS: ${{ matrix.b2_args }}
|
|
CI_GCOVTOOL: ${{ matrix.gcovtool }}
|
|
CI_GIT_BRANCH: ${{ github.base_ref }}
|
|
run: |
|
|
set -ex
|
|
|
|
export CI_PROJECT_DIR=$(pwd)
|
|
export CI_GIT_BRANCH=${CI_GIT_BRANCH:-$(echo $GITHUB_REF | awk 'BEGIN { FS = "/" } ; { print $3 }')}
|
|
export CI_REPO_NAME=$(basename $GITHUB_REPOSITORY)
|
|
|
|
BOOST_BRANCH=develop && [ "$CI_GIT_BRANCH" == "master" ] && BOOST_BRANCH=master || true
|
|
IGNORE_COVERAGE=''
|
|
BOOST_LIBS_FOLDER=$(basename $CI_REPO_NAME)
|
|
UBSAN_OPTIONS=print_stacktrace=1
|
|
LSAN_OPTIONS=verbosity=1:log_threads=1
|
|
BOOST=$HOME/boost-local
|
|
git clone -b $BOOST_BRANCH --depth 10 https://github.com/boostorg/boost.git $BOOST
|
|
cd $BOOST
|
|
git submodule update --init --depth 10 --jobs 2 tools/build tools/boostdep tools/inspect libs/filesystem
|
|
python tools/boostdep/depinst/depinst.py --git_args "--depth 10 --jobs 2" $BOOST/libs/filesystem
|
|
echo "Testing $BOOST/libs/$BOOST_LIBS_FOLDER moved from $CI_PROJECT_DIR, branch $BOOST_BRANCH"
|
|
rm -rf $BOOST/libs/$BOOST_LIBS_FOLDER || true
|
|
cp -rp $CI_PROJECT_DIR $BOOST/libs/$BOOST_LIBS_FOLDER
|
|
python tools/boostdep/depinst/depinst.py --git_args "--depth 10 --jobs 2" $BOOST_LIBS_FOLDER
|
|
git status
|
|
./bootstrap.sh
|
|
./b2 headers
|
|
./b2 -j4 variant=debug tools/inspect/build
|
|
echo "using gcc ;" >> ~/user-config.jam
|
|
echo "using clang ;" >> ~/user-config.jam
|
|
if [ -n "$CI_LLVM_VER" ]; then echo "using clang : ${CI_LLVM_VER} : clang++-${CI_LLVM_VER} ;" >> ~/user-config.jam; fi
|
|
echo "using clang : libc++ : clang++-libc++ ;" >> ~/user-config.jam
|
|
cd $BOOST/libs/$BOOST_LIBS_FOLDER/test/
|
|
|
|
echo '==================================> TEST'
|
|
|
|
sh -c "../../../b2 -j2 $CI_B2_ARGS"
|
|
../../../dist/bin/inspect .. -license -copyright -crlf -end -path_name -tab -ascii -apple_macro -assert_macro -deprecated_macro -minmax -unnamed
|
|
|
|
echo '==================================> AFTER_SUCCESS'
|
|
|
|
mkdir -p $CI_PROJECT_DIR/coverals
|
|
find ../../../bin.v2/ -name "*.gcda" -exec cp "{}" $CI_PROJECT_DIR/coverals/ \;
|
|
find ../../../bin.v2/ -name "*.gcno" -exec cp "{}" $CI_PROJECT_DIR/coverals/ \;
|
|
find ../../../bin.v2/ -name "*.da" -exec cp "{}" $CI_PROJECT_DIR/coverals/ \;
|
|
find ../../../bin.v2/ -name "*.no" -exec cp "{}" $CI_PROJECT_DIR/coverals/ \;
|
|
wget https://github.com/linux-test-project/lcov/archive/v1.14.zip
|
|
unzip v1.14.zip
|
|
LCOV="`pwd`/lcov-1.14/bin/lcov --gcov-tool $CI_GCOVTOOL"
|
|
mkdir -p ~/.local/bin
|
|
echo -e "#!/bin/bash\nexec llvm-cov-${CI_LLVM_VER} gcov \"\$@\"" > ~/.local/bin/gcov_for_clang.sh
|
|
chmod 755 ~/.local/bin/gcov_for_clang.sh
|
|
echo "$LCOV --directory $CI_PROJECT_DIR/coverals --base-directory `pwd` --capture --output-file $CI_PROJECT_DIR/coverals/coverage.info"
|
|
$LCOV --directory $CI_PROJECT_DIR/coverals --base-directory `pwd` --capture --output-file $CI_PROJECT_DIR/coverals/coverage.info
|
|
cd $BOOST
|
|
$LCOV --remove $CI_PROJECT_DIR/coverals/coverage.info "/usr*" "*/$BOOST_LIBS_FOLDER/test/*" $IGNORE_COVERAGE "*/$BOOST_LIBS_FOLDER/tests/*" "*/$BOOST_LIBS_FOLDER/examples/*" "*/$BOOST_LIBS_FOLDER/example/*" -o $CI_PROJECT_DIR/coverals/coverage.info
|
|
OTHER_LIBS=`grep "submodule .*" .gitmodules | sed 's/\[submodule\ "\(.*\)"\]/"\*\/boost\/\1\.hpp" "\*\/boost\/\1\/\*"/g'| sed "/\"\*\/boost\/$BOOST_LIBS_FOLDER\/\*\"/d" | sed ':a;N;$!ba;s/\n/ /g'`
|
|
echo $OTHER_LIBS
|
|
eval "$LCOV --remove $CI_PROJECT_DIR/coverals/coverage.info $OTHER_LIBS -o $CI_PROJECT_DIR/coverals/coverage.info"
|
|
|
|
- name: Coveralls
|
|
uses: coverallsapp/github-action@master
|
|
with:
|
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
path-to-lcov: ./coverals/coverage.info
|