mirror of
https://github.com/msgpack/msgpack-c.git
synced 2025-06-25 22:15:23 +02:00
integrate coverage in github actions
This commit is contained in:
parent
19df3314f4
commit
c0fb6b3b8c
54
.github/workflows/coverage.yml
vendored
Normal file
54
.github/workflows/coverage.yml
vendored
Normal file
@ -0,0 +1,54 @@
|
||||
name: coverage
|
||||
|
||||
on: push
|
||||
|
||||
jobs:
|
||||
|
||||
codecov:
|
||||
timeout-minutes: 30
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: install depends
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install g++-multilib lcov
|
||||
- name: Cache boost
|
||||
id: cache-boost
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: usr
|
||||
key: ${{ runner.os }}-boost-20200107
|
||||
- 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 ..
|
||||
|
||||
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 ..
|
||||
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 .
|
@ -2,6 +2,7 @@
|
||||
===================
|
||||
|
||||
Version 3.2.1 [](https://travis-ci.org/msgpack/msgpack-c) [](https://ci.appveyor.com/project/redboltz/msgpack-c/branch/master)
|
||||
[](https://codecov.io/gh/msgpack/msgpack-c)
|
||||
|
||||
It's like JSON but smaller and faster.
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user