-
Notifications
You must be signed in to change notification settings - Fork 86
76 lines (73 loc) · 2.83 KB
/
coverage.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: Celix Coverage
on: [push, pull_request]
env:
CONAN_USER_HOME: "${{ github.workspace }}/release/"
CONAN_USER_HOME_SHORT: "${{ github.workspace }}/release/short"
CONAN_HOME: "${{ github.workspace }}/release/"
CCACHE_DIR: "${{ github.workspace }}/.ccache"
CCACHE_SLOPPINESS: include_file_ctime,include_file_mtime
jobs:
coverage:
runs-on: ubuntu-20.04
timeout-minutes: 120
steps:
- name: Checkout source code
uses: actions/checkout@v3.3.0
- name: Install conan and lcov
run: |
sudo apt-get install -yq --no-install-recommends lcov
sudo pip install conan==1.62.0 coverage
- name: Setup Conan Profile
run: |
conan profile new default --detect
conan profile update settings.build_type=Debug default
#Note no backwards compatiblity for gcc5 needed, setting libcxx to c++11.
conan profile update settings.compiler.libcxx=libstdc++11 default
- name: Conan Cache
id: cache-conan
uses: actions/cache@v3
env:
cache-name: cache-conan2-modules
with:
path: ${{ env.CONAN_HOME }}
key: ${{ runner.os }}-gcov-builder-${{ env.cache-name }}-${{ hashFiles('conanfile.py') }}
restore-keys: ${{ runner.os }}-gcov-builder-${{ env.cache-name }}-
- name: Prepare ccache timestamp
id: ccache_cache_timestamp
run: |
echo timestamp=`date +"%Y-%m-%d-%H;%M;%S"` >> $GITHUB_OUTPUT
- name: ccache Cache
uses: actions/cache@v3
with:
path: ${{ env.CCACHE_DIR }}
key: ${{ runner.os }}-gcov-ccache-${{ steps.ccache_cache_timestamp.outputs.timestamp }}
restore-keys: |
${{ runner.os }}-gcov-ccache-
- name: Install Dependencies
env:
CONAN_BUILD_OPTIONS: |
-o celix:enable_testing=True
-o celix:build_all=True
-o celix:enable_code_coverage=True
-o celix:enable_testing_on_ci=True
-o celix:enable_ccache=True
run: |
conan install . celix/ci -pr:b default -pr:h default -if build ${CONAN_BUILD_OPTIONS} -b missing --require-override=openssl/1.1.1s
- name: Build
run: |
conan build . -bf build
- name: Test with coverage
run: |
cd build
source conanrun.sh
make coverage
source deactivate_conanrun.sh
lcx="lcov --output-file=coverage.info " && for i in `find . -name "*.info.cleaned"`; do lcx+=" --add-tracefile=$i"; done && $lcx
- name: Codecov
uses: codecov/codecov-action@125fc84a9a348dbcf27191600683ec096ec9021c #v4.4.1
if: github.repository_owner == 'apache'
with:
files: build/coverage.info
disable_search: true
name: codecov-celix
token: ${{ secrets.CODECOV_TOKEN }}