Skip to content

Commit 7ff608e

Browse files
committed
Merge branch 'refactoring' of github.com:mutouyun/cpp-ipc into refactoring
2 parents 6ad9115 + 01da133 commit 7ff608e

File tree

4 files changed

+58
-9
lines changed

4 files changed

+58
-9
lines changed

.github/workflows/c-cpp.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,16 @@ jobs:
1212
runs-on: ubuntu-latest
1313

1414
steps:
15-
- uses: actions/checkout@v2
16-
- name: cmake
15+
- name: Checkout Code
16+
uses: actions/checkout@v2
17+
18+
- name: Configure
1719
run: cmake -DCMAKE_BUILD_TYPE=Release -DLIBIPC_BUILD_TESTS=ON .
18-
- name: make
20+
21+
- name: Build
1922
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

.github/workflows/codecov.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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+
uses: codecov/[email protected]
31+
with:
32+
verbose: true
33+
env:
34+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

CMakeLists.txt

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
cmake_minimum_required(VERSION 3.11)
1+
cmake_minimum_required(VERSION 3.13)
22
project(cpp-ipc)
33

44
option(LIBIPC_BUILD_TESTS "Build all of libipc's own tests." OFF)
55
option(LIBIPC_BUILD_DEMOS "Build all of libipc's own demos." OFF)
66
option(LIBIPC_BUILD_BENCHMARK "Build all of libipc's own benchmark tests." OFF)
77
option(LIBIPC_BUILD_SHARED_LIBS "Build shared libraries (DLLs)." OFF)
88
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)
910

1011
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
1112
set(CMAKE_CXX_STANDARD 17)
@@ -31,8 +32,15 @@ if (MSVC)
3132
endforeach()
3233
endif()
3334
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+
)
3644
endif()
3745

3846
set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin)
@@ -73,4 +81,4 @@ endif()
7381
install(
7482
DIRECTORY "include/"
7583
DESTINATION "include"
76-
)
84+
)

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
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
[![Vcpkg package](https://img.shields.io/badge/Vcpkg-package-blueviolet)](https://github.com/microsoft/vcpkg/tree/master/ports/cpp-ipc)
67

78
A high-performance inter-process communication using shared memory on Linux/Windows.

0 commit comments

Comments
 (0)