File tree 8 files changed +608
-181
lines changed
8 files changed +608
-181
lines changed Original file line number Diff line number Diff line change 1
1
name : CI
2
2
3
- on :
3
+ on :
4
4
push :
5
5
branches :
6
6
- master
45
45
fi
46
46
47
47
sudo python3 -m pip install --upgrade pip
48
- sudo pip3 install scikit-build
48
+ sudo pip3 install scikit-build
49
49
sudo pip3 install cmake requests gitpython gcovr pyyaml
50
50
- name : cmake
51
51
env :
61
61
env :
62
62
CTEST_OUTPUT_ON_FAILURE : 1
63
63
run : cmake --build build --target test
64
+
64
65
# TODO(warchant): on CI (linux/clang) this can not be built, figure out why
65
66
# - name: install & test
66
67
# run: |
Original file line number Diff line number Diff line change
1
+ name : Coverage
2
+
3
+ on :
4
+ push :
5
+ branches :
6
+ - master
7
+ pull_request :
8
+ branches :
9
+ - master
10
+
11
+ jobs :
12
+ coverage :
13
+ name : " Codecov"
14
+ runs-on : ubuntu-latest
15
+ steps :
16
+ - uses : actions/checkout@v1
17
+ name : checkout
18
+ with :
19
+ submodules : true
20
+ clean : true
21
+ fetch-depth : 2
22
+ - name : " install dependencies"
23
+ run : |
24
+ set -e
25
+ sudo apt-get update || true
26
+ sudo apt-get install -y ninja-build
27
+ sudo python3 -m pip install --upgrade pip
28
+ sudo pip3 install scikit-build
29
+ sudo pip3 install cmake requests gitpython gcovr pyyaml
30
+ - name : " cmake"
31
+ env :
32
+ CC : clang
33
+ CXX : clang++
34
+ run : cmake . -GNinja -Bbuild-coverage -DCOVERAGE=ON -DEXAMPLES=OFF
35
+ - name : " build report"
36
+ env :
37
+ CTEST_OUTPUT_ON_FAILURE : 1
38
+ run : cmake --build build-coverage --target ctest_coverage -- -j4
39
+ - name : " upload"
40
+
41
+ with :
42
+ files : build-coverage/ctest_coverage.xml
43
+ verbose : false
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ config/__pycahe__
2
2
** /__pycache__ /*
3
3
__pycache__ /*
4
4
build /*
5
+ build *
5
6
* .DS_Store
6
7
* .vscode /
7
8
* .swp
Original file line number Diff line number Diff line change @@ -37,6 +37,9 @@ print("C flags: ${CMAKE_C_FLAGS}")
37
37
print("CXX flags: ${CMAKE_CXX_FLAGS} " )
38
38
print("Using CMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} " )
39
39
40
+ # the property is out of "if TESTING" scope due to addtest func is out too
41
+ set_property (GLOBAL PROPERTY TEST_TARGETS)
42
+
40
43
include (CheckCXXCompilerFlag)
41
44
include (cmake/install .cmake)
42
45
include (cmake/libp2p_add_library.cmake)
@@ -77,9 +80,6 @@ elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
77
80
# TODO(warchant): add flags https://github.com/lefticus/cppbestpractices/blob/master/02-Use_the_Tools_Available.md#msvc
78
81
endif ()
79
82
80
- if (COVERAGE)
81
- include (cmake/coverage.cmake)
82
- endif ()
83
83
if (CLANG_TIDY)
84
84
include (cmake/clang-tidy.cmake)
85
85
endif ()
@@ -98,8 +98,11 @@ add_subdirectory(src)
98
98
if (EXAMPLES)
99
99
add_subdirectory (example)
100
100
endif ()
101
-
102
- if (TESTING)
101
+ if (TESTING OR COVERAGE)
103
102
enable_testing ()
104
103
add_subdirectory (test )
105
104
endif ()
105
+
106
+ if (COVERAGE)
107
+ include (cmake/coverage.cmake)
108
+ endif ()
You can’t perform that action at this time.
0 commit comments