2121 strategy :
2222 fail-fast : false
2323 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
2533
2634 steps :
2735 - uses : actions/checkout@v2
@@ -40,28 +48,30 @@ jobs:
4048 - name : cmake configure
4149 shell : bash -l {0}
4250 run : |
43- mkdir -p bld
44- cd bld
51+ mkdir -p build
52+ cd build
4553 cmake .. \
4654 -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 }}
4858
4959 - name : build
5060 shell : bash -l {0}
5161 run : |
52- cd bld
62+ cd build
5363 make -j8
5464
5565 - name : install
5666 shell : bash -l {0}
5767 run : |
58- cd bld
68+ cd build
5969 make install
6070
6171 - name : Test xeus-cpp C++
6272 shell : bash -l {0}
6373 run : |
64- cd bld /test
74+ cd build /test
6575 ./test_xeus_cpp
6676 timeout-minutes : 4
6777
7181 cd test
7282 pytest . --reruns 5
7383
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+
74105 win :
75106
76107 runs-on : ${{ matrix.os }}
@@ -98,15 +129,15 @@ jobs:
98129 shell : cmd
99130 run : |
100131 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
103134 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%"
104135
105136 - name : build
106137 shell : cmd
107138 run : |
108139 call C:\Users\runneradmin\micromamba-root\condabin\micromamba.bat activate xeus-cpp
109- cd bld
140+ cd build
110141 set CL=/MP
111142 nmake install
112143
0 commit comments