-
Notifications
You must be signed in to change notification settings - Fork 3
100 lines (80 loc) · 3.87 KB
/
code-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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
name: Code coverage
on:
push:
branches:
- master
jobs:
codecov:
name: Code coverage
runs-on: ubuntu-24.04
env:
BUILD_TYPE: RelWithDebInfo
# CODECOV_TOKEN: 9c75edd2-e08d-48ce-a919-5ee804875918 Not needed for public repository
PROJ_LIB: ${{github.workspace}}/bin/share/proj
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python 3.8
uses: actions/setup-python@v5
with:
python-version: 3.8
- name: Cache Conan libs
id: cache-conan
uses: pat-s/[email protected]
with:
path: /home/runner/.conan
key: conan-osx
- name: Install Conan
run: |
python -m pip install --upgrade pip
pip install wheel conan==1.*
# gitlab support (wxwidgets, mysql, gdal)
conan remote add gitlab https://gitlab.com/api/v4/packages/conan --force
# create default profile with libstdc++11
conan profile new default --detect --force
conan profile update settings.compiler.libcxx=libstdc++11 default
conan profile update conf.tools.system.package_manager:mode=install default
conan profile update conf.tools.system.package_manager:sudo=True default
- name: Install system libs
run: |
sudo apt-get update
# lcov
sudo apt-get install lcov
# GTK 3.0 libraries
sudo apt-get install libgtk-3-0 libgtk-3-dev
sudo apt-get install libxcb-cursor0 libxcb-cursor-dev
sudo apt-get install libgnutlsxx28 libgnutls28-dev
sudo apt-get install libx11-xcb-dev libfontenc-dev libxaw7-dev libxmu-dev libxmuu-dev libxpm-dev libxres-dev libxss-dev
sudo apt-get install libxv-dev libxvmc-dev libxxf86vm-dev libxcb-render-util0-dev libxcb-xkb-dev libxcb-icccm4-dev
sudo apt-get install libxcb-image0-dev libxcb-keysyms1-dev libxcb-randr0-dev libxcb-shape0-dev libxcb-sync-dev
sudo apt-get install libxcb-xfixes0-dev libxcb-xinerama0-dev libxcb-dri3-dev libxcb-util-dev
# needed for MySQL
sudo apt-get install libncurses5-dev libssl-dev libx11-dev libx11-xcb-dev libfontenc-dev libice-dev libsm-dev libxau-dev libxaw7-dev
sudo apt-get install libxcomposite-dev libxcursor-dev libxdamage-dev libxdmcp-dev libxext-dev libxfixes-dev libxft-dev libxi-dev libxinerama-dev
sudo apt-get install libxkbfile-dev libxmu-dev libxmuu-dev libxpm-dev libxrandr-dev libxrender-dev libxres-dev libxss-dev libxt-dev
sudo apt-get install libxtst-dev libxv-dev libxvmc-dev libxxf86vm-dev xtrans-dev libxcb-render0-dev libxcb-render-util0-dev
sudo apt-get install libxcb-xkb-dev libxcb-icccm4-dev libxcb-image0-dev libxcb-keysyms1-dev libxcb-randr0-dev libxcb-shape0-dev libxcb-sync-dev
sudo apt-get install libxcb-xfixes0-dev libxcb-xinerama0-dev xkb-data libxcb-dri3-dev uuid-dev libxcb-util-dev
- name: Install libraries
run: |
mkdir ${{github.workspace}}/bin
cd ${{github.workspace}}/bin
conan install .. -o code_coverage=True --build=gtk --build=missing
- name: Configure CMake
working-directory: ${{github.workspace}}/bin
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DUSE_CODECOV=1 -DUSE_UNITTEST=1
- name: Build and run code coverage
working-directory: ${{github.workspace}}/bin
run: cmake --build . --config ${{env.BUILD_TYPE}} --target code-coverage
- name: Preparing coverage data
working-directory: ${{github.workspace}}/bin
run: lcov --directory . --capture --output-file coverage.info
- name: Display code coverage report
working-directory: ${{github.workspace}}/bin
run: lcov --list coverage.info
- uses: codecov/codecov-action@v4
with:
files: ${{github.workspace}}/bin/coverage.info
fail_ci_if_error: true
verbose: true