Skip to content

Commit 5c0557e

Browse files
authored
Merge pull request #1076 from pbalcer/add-codecov
[common] add codecov
2 parents a1fbbde + 19bcf6c commit 5c0557e

File tree

1 file changed

+78
-0
lines changed

1 file changed

+78
-0
lines changed

.github/workflows/coverage.yml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: Coverage
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
ubuntu-build:
7+
name: Build - Ubuntu
8+
strategy:
9+
matrix:
10+
os: ['ubuntu-22.04']
11+
build_type: [Debug]
12+
compiler: [{c: gcc, cxx: g++}]
13+
libbacktrace: ['-DVAL_USE_LIBBACKTRACE_BACKTRACE=ON']
14+
pool_tracking: ['-DUMF_ENABLE_POOL_TRACKING=ON']
15+
16+
runs-on: ${{matrix.os}}
17+
18+
steps:
19+
- uses: actions/checkout@v3
20+
21+
- name: Install apt packages
22+
run: |
23+
sudo apt-get update
24+
sudo apt-get install -y doxygen ${{matrix.compiler.c}}
25+
26+
- name: Install pip packages
27+
run: pip install -r third_party/requirements.txt
28+
29+
- name: Install libbacktrace
30+
if: matrix.libbacktrace == '-DVAL_USE_LIBBACKTRACE_BACKTRACE=ON'
31+
run: |
32+
git clone https://github.com/ianlancetaylor/libbacktrace.git
33+
cd libbacktrace
34+
./configure
35+
make
36+
sudo make install
37+
cd ..
38+
39+
- name: Download DPC++
40+
run: |
41+
sudo apt install libncurses5
42+
wget -O ${{github.workspace}}/dpcpp_compiler.tar.gz https://github.com/intel/llvm/releases/download/sycl-nightly%2F20230626/dpcpp-compiler.tar.gz
43+
tar -xvf ${{github.workspace}}/dpcpp_compiler.tar.gz
44+
45+
- name: Configure CMake
46+
run: >
47+
cmake
48+
-B${{github.workspace}}/build
49+
-DCMAKE_C_COMPILER=${{matrix.compiler.c}}
50+
-DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
51+
-DUR_ENABLE_TRACING=ON
52+
-DUR_DEVELOPER_MODE=ON
53+
-DCMAKE_BUILD_TYPE=${{matrix.build_type}}
54+
-DUR_BUILD_TESTS=ON
55+
-DUR_FORMAT_CPP_STYLE=ON
56+
-DUR_DPCXX=${{github.workspace}}/dpcpp_compiler/bin/clang++
57+
-DCMAKE_CXX_FLAGS="--coverage -fkeep-inline-functions -fkeep-static-functions"
58+
-DCMAKE_EXE_LINKER_FLAGS="--coverage"
59+
-DCMAKE_SHARED_LINKER_FLAGS="--coverage"
60+
${{matrix.libbacktrace}}
61+
${{matrix.pool_tracking}}
62+
63+
- name: Build
64+
run: cmake --build ${{github.workspace}}/build -j $(nproc)
65+
66+
- name: Test
67+
working-directory: ${{github.workspace}}/build
68+
run: ctest -C ${{matrix.build_type}} --output-on-failure -L "python|umf|loader|validation|tracing|unit|urtrace"
69+
70+
- name: Quick Coverage Info
71+
working-directory: ${{github.workspace}}/build
72+
run: ctest -T Coverage
73+
74+
- name: Upload coverage to Codecov
75+
uses: codecov/codecov-action@v3
76+
with:
77+
gcov: true
78+
gcov_include: source

0 commit comments

Comments
 (0)