21
21
strategy :
22
22
fail-fast : false
23
23
matrix :
24
- os : [ubuntu-latest, macos-latest]
24
+ include :
25
+ - name : ubu
26
+ os : ubuntu-latest
27
+ - name : ubu-analyzers
28
+ os : ubuntu-latest
29
+ coverage : true
30
+ extra_cmake_flags : -DCMAKE_BUILD_TYPE=Debug
31
+ - name : osx
32
+ os : macos-latest
25
33
26
34
steps :
27
35
- uses : actions/checkout@v2
@@ -40,28 +48,30 @@ jobs:
40
48
- name : cmake configure
41
49
shell : bash -l {0}
42
50
run : |
43
- mkdir -p bld
44
- cd bld
51
+ mkdir -p build
52
+ cd build
45
53
cmake .. \
46
54
-DCMAKE_PREFIX_PATH=$CONDA_PREFIX \
47
- -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX
55
+ -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX \
56
+ -DXEUS_CPP_ENABLE_CODE_COVERAGE=${{ matrix.coverage }} \
57
+ ${{ matrix.extra_cmake_flags }}
48
58
49
59
- name : build
50
60
shell : bash -l {0}
51
61
run : |
52
- cd bld
62
+ cd build
53
63
make -j8
54
64
55
65
- name : install
56
66
shell : bash -l {0}
57
67
run : |
58
- cd bld
68
+ cd build
59
69
make install
60
70
61
71
- name : Test xeus-cpp C++
62
72
shell : bash -l {0}
63
73
run : |
64
- cd bld /test
74
+ cd build /test
65
75
./test_xeus_cpp
66
76
timeout-minutes : 4
67
77
71
81
cd test
72
82
pytest . --reruns 5
73
83
84
+ - name : Prepare code coverage report
85
+ if : ${{ success() && (matrix.coverage == true) }}
86
+ shell : bash -l {0}
87
+ run : |
88
+ # Create lcov report
89
+ # Find the current compiler version.
90
+ CC=$(realpath `which c++`)
91
+ vers="${CC##*-}"
92
+ sudo apt install lcov
93
+ # capture coverage info
94
+ lcov --directory build/ --capture --output-file coverage.info --gcov-tool $CONDA_PREFIX/bin/gcov
95
+ lcov --remove coverage.info '/usr/*' "${HOME}"'/.cache/*' ${{ github.workspace }}'/llvm-project/*' ${{ github.workspace }}'/test/*' --output-file coverage.info
96
+ # output coverage data for debugging (optional)
97
+ lcov --list coverage.info
98
+
99
+ - name : Upload to codecov.io
100
+ if : ${{ success() && (matrix.coverage == true) }}
101
+ uses : codecov/codecov-action@v3
102
+ with :
103
+ file : ./coverage.info
104
+
74
105
win :
75
106
76
107
runs-on : ${{ matrix.os }}
@@ -98,15 +129,15 @@ jobs:
98
129
shell : cmd
99
130
run : |
100
131
call C:\Users\runneradmin\micromamba-root\condabin\micromamba.bat activate xeus-cpp
101
- mkdir -p bld
102
- cd bld
132
+ mkdir -p build
133
+ cd build
103
134
cmake .. -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release -DXEUS_BUILD_TESTS=ON -DDEPENDENCY_SEARCH_PREFIX="%CONDA_PREFIX%\Library" -DCMAKE_PREFIX_PATH="%CONDA_PREFIX%\Library" -DCMAKE_INSTALL_PREFIX="%CONDA_PREFIX%"
104
135
105
136
- name : build
106
137
shell : cmd
107
138
run : |
108
139
call C:\Users\runneradmin\micromamba-root\condabin\micromamba.bat activate xeus-cpp
109
- cd bld
140
+ cd build
110
141
set CL=/MP
111
142
nmake install
112
143
0 commit comments