-
Notifications
You must be signed in to change notification settings - Fork 888
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
4 changed files
with
74 additions
and
75 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
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,34 @@ | ||
#!/bin/sh | ||
|
||
usage() | ||
{ | ||
cat <<EOL | ||
-b - 32-bit or 64-bit library, maybe 32, 64 or both | ||
EOL | ||
} | ||
|
||
bit="64" | ||
|
||
while getopts "b:" c; do | ||
case "$c" in | ||
b) | ||
bit="$OPTARG" | ||
[ "$bit" != "32" ] && [ "$bit" != "64" ] && [ "$bit" != "both" ] && usage && exit 1 | ||
;; | ||
?*) | ||
echo "invalid arguments." && exit 1 | ||
;; | ||
esac | ||
done | ||
|
||
[ -z "$CXX" ] && CXX=g++ | ||
|
||
wget https://github.com/google/googletest/archive/release-1.7.0.zip -O googletest-release-1.7.0.zip | ||
unzip -q googletest-release-1.7.0.zip | ||
cd googletest-release-1.7.0 | ||
$CXX -m$bit src/gtest-all.cc -I. -Iinclude -c -fPIC | ||
$CXX -m$bit src/gtest_main.cc -I. -Iinclude -c -fPIC | ||
ar -rv libgtest.a gtest-all.o | ||
ar -rv libgtest_main.a gtest_main.o | ||
cp -r include/gtest /usr/local/include | ||
mv *.a /usr/local/lib |
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 |
---|---|---|
@@ -1,54 +1,45 @@ | ||
name: coverage | ||
|
||
on: push | ||
on: | ||
pull_request: | ||
types: [opened, synchronize] | ||
push: | ||
branches: | ||
- master | ||
tags: | ||
- '*' | ||
|
||
jobs: | ||
|
||
codecov: | ||
coveralls: | ||
timeout-minutes: 30 | ||
runs-on: ubuntu-latest | ||
runs-on: ubuntu-18.04 | ||
|
||
steps: | ||
- uses: actions/checkout@v1 | ||
- uses: actions/checkout@v2.0.0 | ||
- name: install depends | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install g++-multilib lcov | ||
sudo apt-get install g++-multilib lcov | ||
- name: Cache boost | ||
id: cache-boost | ||
uses: actions/cache@v1 | ||
uses: actions/cache@v1.1.0 | ||
with: | ||
path: usr | ||
key: ${{ runner.os }}-boost-20200107 | ||
path: ~/boost | ||
key: ${{ runner.os }}-boost-20200130 | ||
- name: Build boost | ||
if: steps.cache-boost.outputs.cache-hit != 'true' | ||
run: ./.github/depends/boost.sh -b both -t gcc | ||
- name: Compile tests | ||
run: | | ||
# install gtest | ||
BASE=`pwd` | ||
wget https://github.com/google/googletest/archive/release-1.7.0.zip -O googletest-release-1.7.0.zip | ||
unzip -q googletest-release-1.7.0.zip | ||
cd googletest-release-1.7.0 | ||
g++ -m64 src/gtest-all.cc -I. -Iinclude -c -fPIC | ||
g++ -m64 src/gtest_main.cc -I. -Iinclude -c -fPIC | ||
ar -rv libgtest.a gtest-all.o | ||
ar -rv libgtest_main.a gtest_main.o | ||
mkdir -p ${BASE}/usr/include | ||
cp -r include/gtest ${BASE}/usr/include | ||
mkdir -p ${BASE}/usr/lib | ||
mv *.a ${BASE}/usr/lib | ||
cd .. | ||
# install gtest to /usr/local | ||
sudo ./.github/depends/gtest.sh -b 64 | ||
mkdir build && cd build | ||
CMAKE_LIBRARY_PATH="${BASE}/build" GTEST_ROOT="${BASE}/usr" CMAKE_PREFIX_PATH="${BASE}/usr/gcc/lib64/cmake" cmake -DMSGPACK_CXX17=ON -DMSGPACK_32BIT=OFF -DMSGPACK_BOOST=ON -DBUILD_SHARED_LIBS=ON -DMSGPACK_CHAR_SIGN=signed -DMSGPACK_USE_X3_PARSE=ON -DMSGPACK_ENABLE_CXX=ON -DMSGPACK_BUILD_EXAMPLES=ON -DMSGPACK_BUILD_TESTS=ON -DCMAKE_BUILD_TYPE=Debug -DMSGPACK_GEN_COVERAGE=ON .. | ||
cmake -DCMAKE_PREFIX_PATH="${HOME}/boost/gcc/lib64/cmake" -DMSGPACK_CXX17=ON -DMSGPACK_32BIT=OFF -DMSGPACK_BOOST=ON -DBUILD_SHARED_LIBS=ON -DMSGPACK_CHAR_SIGN=signed -DMSGPACK_USE_X3_PARSE=ON -DMSGPACK_ENABLE_CXX=ON -DMSGPACK_BUILD_EXAMPLES=ON -DMSGPACK_BUILD_TESTS=ON -DCMAKE_BUILD_TYPE=Debug -DMSGPACK_GEN_COVERAGE=ON .. | ||
make -j4 | ||
make test | ||
- name: Upload coverage to Codecov | ||
working-directory: build | ||
env: | ||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | ||
run: | | ||
wget https://codecov.io/bash -O codecov | ||
chmod +x codecov | ||
./codecov -t $CODECOV_TOKEN -B $GITHUB_REF -s . | ||
make coverage | ||
- name: Coveralls GitHub Action | ||
uses: coverallsapp/[email protected] | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
path-to-lcov: ./build/coverage.info.cleaned |
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