File tree Expand file tree Collapse file tree 3 files changed +42
-0
lines changed
Expand file tree Collapse file tree 3 files changed +42
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Upload CodeCov Report
2+
3+ on :
4+ push :
5+ branches : [ master ]
6+ pull_request :
7+ branches : [ master ]
8+
9+ jobs :
10+ build :
11+
12+ runs-on : ubuntu-latest
13+
14+ steps :
15+ - name : Checkout Code
16+ uses : actions/checkout@v2
17+
18+ - name : Configure
19+ run : cmake -DCMAKE_BUILD_TYPE=Debug -DLIBIPC_BUILD_TESTS=ON -DLIBIPC_CODECOV=ON .
20+
21+ - name : Build
22+ run : make -j
23+
24+ - name : Test
25+ env :
26+ LD_LIBRARY_PATH : ./bin
27+ run : ./bin/test-ipc
28+
29+ - name : Upload coverage to Codecov
30+ 31+ with :
32+ verbose : true
33+ env :
34+ CODECOV_TOKEN : ${{ secrets.CODECOV_TOKEN }}
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ option(LIBIPC_BUILD_TESTS "Build all of libipc's own tests."
55option (LIBIPC_BUILD_DEMOS "Build all of libipc's own demos." OFF )
66option (LIBIPC_BUILD_SHARED_LIBS "Build shared libraries (DLLs)." OFF )
77option (LIBIPC_USE_STATIC_CRT "Set to ON to build with static CRT on Windows (/MT)." OFF )
8+ option (LIBIPC_CODECOV "Build with unit test coverage." OFF )
89
910set (CMAKE_POSITION_INDEPENDENT_CODE ON )
1011set (CMAKE_CXX_STANDARD 17)
@@ -13,6 +14,12 @@ if(NOT MSVC)
1314 set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O2" )
1415endif ()
1516
17+ # Code coverage support
18+ if (LIBIPC_CODECOV AND NOT MSVC )
19+ add_compile_options (--coverage)
20+ add_link_options (-lgcov --coverage)
21+ endif ()
22+
1623if (MSVC )
1724 set (CompilerFlags
1825 CMAKE_CXX_FLAGS
Original file line number Diff line number Diff line change 22
33[ ![ MIT licensed] ( https://img.shields.io/badge/license-MIT-blue.svg )] ( https://github.com/mutouyun/cpp-ipc/blob/master/LICENSE )
44[ ![ Build Status] ( https://github.com/mutouyun/cpp-ipc/actions/workflows/c-cpp.yml/badge.svg )] ( https://github.com/mutouyun/cpp-ipc/actions )
5+ [ ![ CodeCov] ( https://codecov.io/github/mutouyun/cpp-ipc/graph/badge.svg?token=MNOAOLNELH )] ( https://codecov.io/github/mutouyun/cpp-ipc )
56[ ![ Build status] ( https://ci.appveyor.com/api/projects/status/github/mutouyun/cpp-ipc?branch=master&svg=true )] ( https://ci.appveyor.com/project/mutouyun/cpp-ipc )
67[ ![ Vcpkg package] ( https://img.shields.io/badge/Vcpkg-package-blueviolet )] ( https://github.com/microsoft/vcpkg/tree/master/ports/cpp-ipc )
78
You can’t perform that action at this time.
0 commit comments