File tree Expand file tree Collapse file tree 4 files changed +58
-9
lines changed Expand file tree Collapse file tree 4 files changed +58
-9
lines changed Original file line number Diff line number Diff line change @@ -12,10 +12,16 @@ jobs:
12
12
runs-on : ubuntu-latest
13
13
14
14
steps :
15
- - uses : actions/checkout@v2
16
- - name : cmake
15
+ - name : Checkout Code
16
+ uses : actions/checkout@v2
17
+
18
+ - name : Configure
17
19
run : cmake -DCMAKE_BUILD_TYPE=Release -DLIBIPC_BUILD_TESTS=ON .
18
- - name : make
20
+
21
+ - name : Build
19
22
run : make -j
20
- - name : test
21
- run : export LD_LIBRARY_PATH=./lib:$LD_LIBRARY_PATH && ./bin/test-ipc
23
+
24
+ - name : Test
25
+ env :
26
+ LD_LIBRARY_PATH : ./lib
27
+ run : ./bin/test-ipc
Original file line number Diff line number Diff line change
1
+ name : Upload CodeCov Report
2
+
3
+ on :
4
+ push :
5
+ branches : [ refactoring ]
6
+ pull_request :
7
+ branches : [ refactoring ]
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 : ./lib
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 1
- cmake_minimum_required (VERSION 3.11 )
1
+ cmake_minimum_required (VERSION 3.13 )
2
2
project (cpp-ipc )
3
3
4
4
option (LIBIPC_BUILD_TESTS "Build all of libipc's own tests." OFF )
5
5
option (LIBIPC_BUILD_DEMOS "Build all of libipc's own demos." OFF )
6
6
option (LIBIPC_BUILD_BENCHMARK "Build all of libipc's own benchmark tests." OFF )
7
7
option (LIBIPC_BUILD_SHARED_LIBS "Build shared libraries (DLLs)." OFF )
8
8
option (LIBIPC_USE_STATIC_CRT "Set to ON to build with static CRT on Windows (/MT)." OFF )
9
+ option (LIBIPC_CODECOV "Build with unit test coverage." OFF )
9
10
10
11
set (CMAKE_POSITION_INDEPENDENT_CODE ON )
11
12
set (CMAKE_CXX_STANDARD 17 )
@@ -31,8 +32,15 @@ if (MSVC)
31
32
endforeach ()
32
33
endif ()
33
34
else ()
34
- set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DNDEBUG -O2" )
35
- set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g -rdynamic -fsanitize=address" )
35
+ add_compile_options (
36
+ "$<$<BOOL:${LIBIPC_CODECOV} >:SHELL:--coverage>"
37
+ "$<$<CONFIG:Release>:SHELL:-DNDEBUG -O2>"
38
+ "$<$<CONFIG:Debug>:SHELL:-g -rdynamic -fsanitize=address>"
39
+ )
40
+ add_link_options (
41
+ "$<$<BOOL:${LIBIPC_CODECOV} >:SHELL:-lgcov --coverage>"
42
+ "$<$<CONFIG:Debug>:SHELL:-fsanitize=address>"
43
+ )
36
44
endif ()
37
45
38
46
set (LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR} /bin )
@@ -73,4 +81,4 @@ endif()
73
81
install (
74
82
DIRECTORY "include/"
75
83
DESTINATION "include"
76
- )
84
+ )
Original file line number Diff line number Diff line change 2
2
3
3
[ ![ MIT licensed] ( https://img.shields.io/badge/license-MIT-blue.svg )] ( https://github.com/mutouyun/cpp-ipc/blob/master/LICENSE )
4
4
[ ![ 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 )
5
6
[ ![ Vcpkg package] ( https://img.shields.io/badge/Vcpkg-package-blueviolet )] ( https://github.com/microsoft/vcpkg/tree/master/ports/cpp-ipc )
6
7
7
8
A high-performance inter-process communication using shared memory on Linux/Windows.
You can’t perform that action at this time.
0 commit comments