From 585f796de96390051a794d1a2a511d0c245dd9cc Mon Sep 17 00:00:00 2001 From: yuangongji Date: Sun, 2 Feb 2020 19:38:16 +0800 Subject: [PATCH] replace codecov wiith coveralls --- .github/depends/boost.sh | 4 +-- .github/depends/gtest.sh | 34 ++++++++++++++++++++ .github/workflows/coverage.yml | 57 ++++++++++++++-------------------- .github/workflows/gha.yml | 54 +++++++++----------------------- 4 files changed, 74 insertions(+), 75 deletions(-) create mode 100755 .github/depends/gtest.sh diff --git a/.github/depends/boost.sh b/.github/depends/boost.sh index ab96f81b2..cc4574c47 100755 --- a/.github/depends/boost.sh +++ b/.github/depends/boost.sh @@ -10,8 +10,8 @@ EOL build_boost() { - BASE=`pwd`/.. - ./b2 -j4 --toolset=$1 --prefix=${BASE}/usr --libdir="${BASE}/usr/$1/lib$2" --with-chrono --with-context --with-filesystem --with-system --with-timer address-model=$2 install + prefix=$HOME/boost + ./b2 -j4 --toolset=$1 --prefix=$prefix --libdir="$prefix/$1/lib$2" --with-chrono --with-context --with-filesystem --with-system --with-timer address-model=$2 install } bit="64" diff --git a/.github/depends/gtest.sh b/.github/depends/gtest.sh new file mode 100755 index 000000000..bf4be0fd2 --- /dev/null +++ b/.github/depends/gtest.sh @@ -0,0 +1,34 @@ +#!/bin/sh + +usage() +{ + cat < tmp1 && find include -name "*.h" -o -name "*.hpp" | sort > tmp2 && diff tmp1 tmp2 linux: @@ -93,7 +80,7 @@ jobs: matrix: pattern: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11] steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2.0.0 - name: install g++-multilib run: | sudo apt-get install g++-multilib @@ -107,18 +94,16 @@ jobs: sudo apt-get install valgrind - 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: build and test shell: bash run: | - BASE=`pwd`; - # matrix config if [ ${{ matrix.pattern }} == 0 ]; then export CC=clang @@ -237,19 +222,8 @@ jobs: export ARCH="64" fi - # install gtest - 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${ARCH} src/gtest-all.cc -I. -Iinclude -c -fPIC - $CXX -m${ARCH} 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 ${ARCH} # install zlib if [ ${ARCH} == 32 ]; then @@ -257,7 +231,7 @@ jobs: fi # build and test - CMAKE_CXX_COMPILER="${CXX}" CMAKE_C_COMPILER="${CC}" CMAKE_LIBRARY_PATH="${BASE}/usr/lib:${BASE}/build" GTEST_ROOT="${BASE}/usr" CMAKE_PREFIX_PATH="${BASE}/usr/gcc/lib${ARCH}/cmake" CFLAGS="-Werror -g" CXXFLAGS="-Werror -g" MSGPACK_SAN="${SAN}" ${ACTION} + CMAKE_CXX_COMPILER="${CXX}" CMAKE_C_COMPILER="${CC}" CMAKE_PREFIX_PATH="${HOME}/boost/gcc/lib${ARCH}/cmake" CFLAGS="-Werror -g" CXXFLAGS="-Werror -g" MSGPACK_SAN="${SAN}" ${ACTION} cat Files.cmake| grep ".*\.[h|hpp]" | perl -pe 's/ //g' | sort > tmp1 && find include -name "*.h" -o -name "*.hpp" | sort > tmp2 && diff tmp1 tmp2 windows: runs-on: windows-2016