Skip to content

Commit 26f66b5

Browse files
committed
update CIs
1 parent 7b19672 commit 26f66b5

2 files changed

Lines changed: 171 additions & 188 deletions

File tree

.github/workflows/ci.yml

Lines changed: 166 additions & 178 deletions
Original file line numberDiff line numberDiff line change
@@ -1,202 +1,190 @@
1-
name: GitHub Actions CI
1+
name: CI
22

33
on:
44
pull_request:
55
push:
66
branches:
77
- master
88
- develop
9-
- githubactions*
109
- feature/**
11-
- fix/**
12-
- pr/**
10+
11+
env:
12+
UBSAN_OPTIONS: print_stacktrace=1
1313

1414
jobs:
1515
posix:
1616
strategy:
1717
fail-fast: false
1818
matrix:
1919
include:
20-
- name: "GCC-6, no RTTI"
21-
buildtype: "boost"
22-
packages: "g++-6"
23-
packages_to_remove: ""
24-
os: "ubuntu-16.04"
25-
cxx: "g++"
26-
sources: ""
27-
llvm_os: ""
28-
llvm_ver: ""
29-
b2_args: "cxxstd=98,03,11,14,1y toolset=gcc-6 cxxflags=\"--coverage -fsanitize=address,leak,undefined -fno-sanitize-recover=undefined -DBOOST_TRAVISCI_BUILD -fno-rtti\" linkflags=\"--coverage -lasan -lubsan\" \"testing.launcher=LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libasan.so.3\""
30-
gcovtool: "gcov-6"
31-
- name: "GCC-8"
32-
buildtype: "boost"
33-
packages: "g++-8"
34-
packages_to_remove: ""
35-
os: "ubuntu-16.04"
36-
cxx: "g++"
37-
sources: ""
38-
llvm_os: ""
39-
llvm_ver: ""
40-
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\" \"testing.launcher=LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libasan.so.5\""
41-
gcovtool: "gcov-8"
42-
- name: "GCC-4.6"
43-
buildtype: "boost"
44-
packages: "g++-4.6"
45-
packages_to_remove: ""
46-
os: "ubuntu-16.04"
47-
cxx: "g++"
48-
sources: ""
49-
llvm_os: ""
50-
llvm_ver: ""
51-
b2_args: "cxxstd=98,0x toolset=gcc-4.6 cxxflags=\"--coverage -DBOOST_TRAVISCI_BUILD\" linkflags=\"--coverage\""
52-
gcovtool: "gcov-4.6"
53-
- name: "Clang-8"
54-
buildtype: "boost"
55-
packages: "clang-8"
56-
packages_to_remove: ""
57-
os: "ubuntu-16.04"
58-
cxx: "g++"
59-
sources: ""
60-
llvm_os: "xenial"
61-
llvm_ver: "8"
62-
b2_args: "cxxstd=98,03,11,14,1z toolset=clang-8 cxxflags=\"--coverage -fsanitize=address,leak -DBOOST_TRAVISCI_BUILD\" linkflags=\"--coverage -fsanitize=address,leak\""
63-
gcovtool: "gcov_for_clang.sh"
64-
- name: "Clang-8 libc++"
65-
buildtype: "boost"
66-
packages: "clang-8 libc++-8-dev libc++abi-8-dev"
67-
packages_to_remove: ""
68-
os: "ubuntu-16.04"
69-
cxx: "g++"
70-
sources: ""
71-
llvm_os: "xenial"
72-
llvm_ver: "8"
73-
b2_args: "cxxstd=03,11,14 toolset=clang-8 cxxflags=\"-stdlib=libc++ --coverage -DBOOST_TRAVISCI_BUILD\" linkflags=\"-stdlib=libc++ --coverage\""
74-
gcovtool: "gcov_for_clang.sh"
75-
76-
runs-on: ${{ matrix.os }}
77-
container: ${{ matrix.container }}
20+
- toolset: gcc-4.8
21+
cxxstd: "03,11"
22+
os: ubuntu-16.04
23+
install: g++-4.8
24+
- toolset: gcc-7
25+
cxxstd: "03,11,14,17"
26+
os: ubuntu-18.04
27+
- toolset: gcc-9
28+
cxxstd: "03,11,14,17,2a"
29+
os: ubuntu-18.04
30+
- toolset: gcc-10
31+
cxxstd: "03,11,14,17,2a"
32+
os: ubuntu-18.04
33+
cxxflags: "cxxflags=--coverage -fsanitize=address,leak,undefined -fno-sanitize-recover=undefined"
34+
linkflags: "linkflags=--coverage -lasan -lubsan"
35+
gcov_tool: "gcov-10"
36+
- toolset: clang
37+
compiler: clang++-3.7
38+
cxxstd: "03,11,14"
39+
os: ubuntu-16.04
40+
install: clang-3.7
41+
- toolset: clang
42+
compiler: clang++-9
43+
cxxstd: "03,11,14,17,2a"
44+
os: ubuntu-20.04
45+
cxxflags: "cxxflags=--coverage"
46+
linkflags: "linkflags=--coverage"
47+
gcov_tool: "llvm-cov-9 gcov"
48+
- toolset: clang
49+
compiler: clang++-10
50+
cxxstd: "03,11,14,17,2a"
51+
os: ubuntu-20.04
52+
- toolset: clang
53+
cxxstd: "03,11,14,17,2a"
54+
os: macos-10.15
55+
cxxflags: "cxxflags=-fsanitize=address,undefined -fno-sanitize-recover=undefined"
56+
linkflags: "linkflags=-fsanitize=address,undefined"
7857

79-
steps:
80-
- name: Check if running in container
81-
if: matrix.container != ''
82-
run: echo "GHA_CONTAINER=${{ matrix.container }}" >> $GITHUB_ENV
58+
runs-on: ${{matrix.os}}
8359

60+
steps:
8461
- uses: actions/checkout@v2
8562

86-
- name: linux
87-
shell: bash
88-
env:
89-
CXX: ${{ matrix.cxx }}
90-
SOURCES: ${{ matrix.sources }}
91-
LLVM_OS: ${{ matrix.llvm_os }}
92-
LLVM_VER: ${{ matrix.llvm_ver }}
93-
PACKAGES: ${{ matrix.packages }}
94-
PACKAGES_TO_REMOVE: ${{ matrix.packages_to_remove }}
95-
JOB_BUILDTYPE: ${{ matrix.buildtype }}
96-
B2_ARGS: ${{ matrix.b2_args }}
97-
GCOVTOOL: ${{ matrix.gcovtool }}
98-
TRAVIS_BRANCH: ${{ github.base_ref }}
99-
TRAVIS_OS_NAME: "linux"
63+
- name: Install packages
64+
if: matrix.install
65+
run: sudo apt install ${{matrix.install}}
66+
67+
- name: Setup Boost
10068
run: |
101-
echo '==================================> SETUP'
102-
echo '==================================> PACKAGES'
103-
sudo ln -s /usr/bin/llvm-cov-9 /usr/bin/llvm-cov
104-
set -e
105-
if [ -n "$PACKAGES_TO_REMOVE" ]; then sudo apt-get purge -y $PACKAGES_TO_REMOVE; fi
106-
echo ">>>>> APT: REPO.."
107-
for i in {1..3}; do sudo -E apt-add-repository -y "ppa:ubuntu-toolchain-r/test" && break || sleep 2; done
108-
109-
if test -n "${LLVM_OS}" ; then
110-
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
111-
if test -n "${LLVM_VER}" ; then
112-
sudo -E apt-add-repository "deb http://apt.llvm.org/${LLVM_OS}/ llvm-toolchain-${LLVM_OS}-${LLVM_VER} main"
113-
else
114-
# Snapshot (i.e. trunk) build of clang
115-
sudo -E apt-add-repository "deb http://apt.llvm.org/${LLVM_OS}/ llvm-toolchain-${LLVM_OS} main"
116-
fi
117-
fi
118-
echo ">>>>> APT: UPDATE.."
119-
sudo -E apt-get -o Acquire::Retries=3 update
120-
if test -n "${SOURCES}" ; then
121-
echo ">>>>> APT: INSTALL SOURCES.."
122-
for SOURCE in $SOURCES; do
123-
sudo -E apt-add-repository ppa:$SOURCE
124-
done
125-
fi
126-
echo ">>>>> APT: INSTALL ${PACKAGES}.."
127-
sudo -E DEBIAN_FRONTEND=noninteractive apt-get -o Acquire::Retries=3 -y --no-install-suggests --no-install-recommends install ${PACKAGES}
128-
129-
echo '==================================> INSTALL AND COMPILE'
130-
set -e
131-
export TRAVIS_BUILD_DIR=$(pwd)
132-
export TRAVIS_BRANCH=${TRAVIS_BRANCH:-$(echo $GITHUB_REF | awk 'BEGIN { FS = "/" } ; { print $3 }')}
133-
export VCS_COMMIT_ID=$GITHUB_SHA
134-
export GIT_COMMIT=$GITHUB_SHA
135-
export REPO_NAME=$(basename $GITHUB_REPOSITORY)
136-
export USER=$(whoami)
137-
export CC=${CC:-gcc}
138-
export PATH=~/.local/bin:/usr/local/bin:$PATH
139-
140-
if [ "$JOB_BUILDTYPE" == "boost" ]; then
141-
142-
echo '==================================> INSTALL'
143-
144-
BOOST_BRANCH=develop && [ "$TRAVIS_BRANCH" == "master" ] && BOOST_BRANCH=master || true
145-
IGNORE_COVERAGE='*/filesystem/src/* */thread/src/pthread/* */thread/src/future.cpp */timer/src/* operators.hpp'
146-
BOOST_LIBS_FOLDER=$(basename $REPO_NAME)
147-
UBSAN_OPTIONS=print_stacktrace=1
148-
LSAN_OPTIONS=verbosity=1:log_threads=1
149-
BOOST=$HOME/boost-local
150-
git clone -b $BOOST_BRANCH --depth 10 https://github.com/boostorg/boost.git $BOOST
151-
cd $BOOST
152-
git submodule update --init --depth 10 --jobs 2 tools/build tools/boostdep tools/inspect libs/filesystem libs/interprocess
153-
python tools/boostdep/depinst/depinst.py --git_args "--depth 10 --jobs 2" $BOOST/libs/filesystem
154-
echo "Testing $BOOST/libs/$BOOST_LIBS_FOLDER moved from $TRAVIS_BUILD_DIR, branch $BOOST_BRANCH"
155-
rm -rf $BOOST/libs/$BOOST_LIBS_FOLDER || true
156-
cp -rp $TRAVIS_BUILD_DIR $BOOST/libs/$BOOST_LIBS_FOLDER
157-
python tools/boostdep/depinst/depinst.py --git_args "--depth 10 --jobs 2" $BOOST_LIBS_FOLDER
158-
git status
69+
echo GITHUB_REPOSITORY: $GITHUB_REPOSITORY
70+
LIBRARY=${GITHUB_REPOSITORY#*/}
71+
echo LIBRARY: $LIBRARY
72+
echo "LIBRARY=$LIBRARY" >> $GITHUB_ENV
73+
echo GITHUB_BASE_REF: $GITHUB_BASE_REF
74+
echo GITHUB_REF: $GITHUB_REF
75+
REF=${GITHUB_BASE_REF:-$GITHUB_REF}
76+
REF=${REF#refs/heads/}
77+
echo REF: $REF
78+
BOOST_BRANCH=develop && [ "$REF" == "master" ] && BOOST_BRANCH=master || true
79+
echo BOOST_BRANCH: $BOOST_BRANCH
80+
cd ..
81+
git clone -b $BOOST_BRANCH --depth 10 https://github.com/boostorg/boost.git boost-root
82+
cd boost-root
83+
git submodule update --init --depth 10 --jobs 2 tools/boostdep tools/inspect libs/filesystem
84+
python tools/boostdep/depinst/depinst.py --git_args "--depth 10 --jobs 3" filesystem
85+
rm -rf libs/$LIBRARY/*
86+
cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY
87+
python tools/boostdep/depinst/depinst.py --git_args "--depth 10 --jobs 3" $LIBRARY
15988
./bootstrap.sh
160-
./b2 headers
89+
./b2 -d0 headers
16190
./b2 -j4 variant=debug tools/inspect/build
162-
echo "using gcc ;" >> ~/user-config.jam
163-
echo "using clang ;" >> ~/user-config.jam
164-
echo "using clang : 3.8 : clang++-3.8 ;" >> ~/user-config.jam
165-
echo "using clang : 4 : clang++-4.0 ;" >> ~/user-config.jam
166-
echo "using clang : 5 : clang++-5.0 ;" >> ~/user-config.jam
167-
echo "using clang : 6 : clang++-6.0 ;" >> ~/user-config.jam
168-
echo "using clang : 7 : clang++-7.0 ;" >> ~/user-config.jam
169-
echo "using clang : 8 : clang++-8 ;" >> ~/user-config.jam
170-
echo "using clang : libc++ : clang++-libc++ ;" >> ~/user-config.jam
171-
cd $BOOST/libs/$BOOST_LIBS_FOLDER/test/
172-
173-
echo '==================================> SCRIPT'
174-
175-
sh -c "../../../b2 -j2 $B2_ARGS"
176-
../../../dist/bin/inspect .. -license -copyright -crlf -end -path_name -tab -ascii -apple_macro -deprecated_macro -minmax -unnamed -assert_macro
177-
178-
echo '==================================> AFTER_SUCCESS'
179-
180-
mkdir -p $TRAVIS_BUILD_DIR/coverals
181-
find ../../../bin.v2/ -name "*.gcda" -exec cp "{}" $TRAVIS_BUILD_DIR/coverals/ \;
182-
find ../../../bin.v2/ -name "*.gcno" -exec cp "{}" $TRAVIS_BUILD_DIR/coverals/ \;
183-
find ../../../bin.v2/ -name "*.da" -exec cp "{}" $TRAVIS_BUILD_DIR/coverals/ \;
184-
find ../../../bin.v2/ -name "*.no" -exec cp "{}" $TRAVIS_BUILD_DIR/coverals/ \;
185-
wget https://github.com/linux-test-project/lcov/archive/v1.14.zip
186-
unzip v1.14.zip
187-
LCOV="`pwd`/lcov-1.14/bin/lcov --gcov-tool $GCOVTOOL"
188-
mkdir -p ~/.local/bin
189-
echo -e '#!/bin/bash\nexec llvm-cov gcov "$@"' > ~/.local/bin/gcov_for_clang.sh
190-
chmod 755 ~/.local/bin/gcov_for_clang.sh
191-
echo "$LCOV --directory $TRAVIS_BUILD_DIR/coverals --base-directory `pwd` --capture --output-file $TRAVIS_BUILD_DIR/coverals/coverage.info"
192-
$LCOV --directory $TRAVIS_BUILD_DIR/coverals --base-directory `pwd` --capture --output-file $TRAVIS_BUILD_DIR/coverals/coverage.info
193-
cd $BOOST
194-
$LCOV --remove $TRAVIS_BUILD_DIR/coverals/coverage.info "/usr*" "*/$BOOST_LIBS_FOLDER/test/*" $IGNORE_COVERAGE "*/$BOOST_LIBS_FOLDER/tests/*" "*/$BOOST_LIBS_FOLDER/examples/*" "*/$BOOST_LIBS_FOLDER/example/*" -o $TRAVIS_BUILD_DIR/coverals/coverage.info
195-
OTHER_LIBS=`grep "submodule .*" .gitmodules | sed 's/\[submodule\ "\(.*\)"\]/"\*\/boost\/\1\.hpp" "\*\/boost\/\1\/\*" "\*\/libs\/\1\/src\/\*"/g'| sed "/\"\*\/boost\/$BOOST_LIBS_FOLDER\/\*\"/d" | sed ':a;N;$!ba;s/\n/ /g'`
91+
92+
- name: Create user-config.jam
93+
if: matrix.compiler
94+
run: |
95+
echo "using ${{matrix.toolset}} : : ${{matrix.compiler}} ;" > ~/user-config.jam
96+
97+
- name: Run tests
98+
run: |
99+
cd ../boost-root
100+
./b2 -j3 libs/$LIBRARY/test toolset=${{matrix.toolset}} cxxstd=${{matrix.cxxstd}} variant=debug,release "${{matrix.cxxflags}}" "${{matrix.linkflags}}" "${{matrix.launcher}}"
101+
dist/bin/inspect libs/$LIBRARY/test
102+
103+
- name: Prepare coverage data
104+
if: matrix.gcov_tool
105+
run: |
106+
mkdir -p $GITHUB_WORKSPACE/coveralls
107+
108+
echo -e "#!/bin/bash\nexec ${{matrix.gcov_tool}} \"\$@\"" > $GITHUB_WORKSPACE/coveralls/gcov_wrapper.sh
109+
chmod +x $GITHUB_WORKSPACE/coveralls/gcov_wrapper.sh
110+
wget https://github.com/linux-test-project/lcov/archive/v1.15.zip
111+
unzip v1.15.zip
112+
LCOV="`pwd`/lcov-1.15/bin/lcov --gcov-tool $GITHUB_WORKSPACE/coveralls/gcov_wrapper.sh"
113+
114+
echo "$LCOV --directory $GITHUB_WORKSPACE/coveralls --base-directory `pwd`/libs/$LIBRARY/test --capture --output-file $GITHUB_WORKSPACE/coveralls/coverage.info"
115+
$LCOV --directory ../boost-root/bin.v2/libs/$LIBRARY/ --base-directory ../boost-root/ --capture --output-file $GITHUB_WORKSPACE/coveralls/coverage.info
116+
$LCOV --remove $GITHUB_WORKSPACE/coveralls/coverage.info "/usr*" "*/$LIBRARY/test/*" ${{matrix.ignore_coverage}} "*/$LIBRARY/tests/*" "*/$LIBRARY/examples/*" "*/$LIBRARY/example/*" -o $GITHUB_WORKSPACE/coveralls/coverage.info
117+
118+
cd ../boost-root
119+
OTHER_LIBS=`grep "submodule .*" .gitmodules | sed 's/\[submodule\ "\(.*\)"\]/"\*\/boost\/\1\.hpp" "\*\/boost\/\1\/\*"/g'| sed "/\"\*\/boost\/$LIBRARY\/\*\"/d" | sed ':a;N;$!ba;s/\n/ /g'`
196120
echo $OTHER_LIBS
197-
eval "$LCOV --remove $TRAVIS_BUILD_DIR/coverals/coverage.info $OTHER_LIBS -o $TRAVIS_BUILD_DIR/coverals/coverage.info"
198-
cd $TRAVIS_BUILD_DIR
199-
sudo gem install coveralls-lcov || echo "ERROR. Failed to install coveralls-lcov"
200-
coveralls-lcov coverals/coverage.info
121+
eval "$LCOV --remove $GITHUB_WORKSPACE/coveralls/coverage.info $OTHER_LIBS -o $GITHUB_WORKSPACE/coveralls/coverage.info"
122+
123+
- name: Coveralls
124+
uses: coverallsapp/github-action@master
125+
if: matrix.gcov_tool
126+
with:
127+
github-token: ${{ secrets.GITHUB_TOKEN }}
128+
path-to-lcov: ./coveralls/coverage.info
129+
parallel: true
201130

202-
fi
131+
windows:
132+
strategy:
133+
fail-fast: false
134+
matrix:
135+
include:
136+
- toolset: msvc-14.1
137+
cxxstd: "14,17,latest"
138+
addrmd: 32,64
139+
os: windows-2016
140+
- toolset: msvc-14.2
141+
cxxstd: "14,17,latest"
142+
addrmd: 32,64
143+
os: windows-2019
144+
- toolset: gcc
145+
cxxstd: "03,11,14,17,2a"
146+
addrmd: 64
147+
os: windows-2019
148+
149+
runs-on: ${{matrix.os}}
150+
151+
steps:
152+
- uses: actions/checkout@v2
153+
154+
- name: Setup Boost
155+
shell: cmd
156+
run: |
157+
echo GITHUB_REPOSITORY: %GITHUB_REPOSITORY%
158+
for /f %%i in ("%GITHUB_REPOSITORY%") do set LIBRARY=%%~nxi
159+
echo LIBRARY: %LIBRARY%
160+
echo LIBRARY=%LIBRARY%>>%GITHUB_ENV%
161+
echo GITHUB_BASE_REF: %GITHUB_BASE_REF%
162+
echo GITHUB_REF: %GITHUB_REF%
163+
if "%GITHUB_BASE_REF%" == "" set GITHUB_BASE_REF=%GITHUB_REF%
164+
set BOOST_BRANCH=develop
165+
for /f %%i in ("%GITHUB_BASE_REF%") do if "%%~nxi" == "master" set BOOST_BRANCH=master
166+
echo BOOST_BRANCH: %BOOST_BRANCH%
167+
cd ..
168+
git clone -b %BOOST_BRANCH% --depth 1 https://github.com/boostorg/boost.git boost-root
169+
cd boost-root
170+
xcopy /s /e /q %GITHUB_WORKSPACE% libs\%LIBRARY%\
171+
git submodule update --init tools/boostdep
172+
python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" %LIBRARY%
173+
cmd /c bootstrap
174+
b2 -d0 headers
175+
176+
- name: Run tests
177+
shell: cmd
178+
run: |
179+
cd ../boost-root
180+
b2 -j3 libs/%LIBRARY%/test toolset=${{matrix.toolset}} cxxstd=${{matrix.cxxstd}} address-model=${{matrix.addrmd}} variant=debug,release
181+
182+
finish:
183+
needs: posix
184+
runs-on: ubuntu-latest
185+
steps:
186+
- name: Coveralls Finished
187+
uses: coverallsapp/github-action@master
188+
with:
189+
github-token: ${{ secrets.github_token }}
190+
parallel-finished: true

0 commit comments

Comments
 (0)