-
Notifications
You must be signed in to change notification settings - Fork 2
145 lines (122 loc) · 4.39 KB
/
build-and-test.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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
# SPDX-License-Identifier: BSD-2-Clause
#
# SPDX-FileCopyrightText: 2023 Kai Uwe Broulik <[email protected]>
name: Builds and Tests
on: ["push", "pull_request"]
jobs:
build-and-test-library:
strategy:
matrix:
config:
- {name: "Ubuntu 22.04 (GCC)", os: "ubuntu-22.04", CC: "gcc", CXX: "g++"}
#- {name: "Ubuntu 22.04 (Clang)", os: "ubuntu-22.04", CC: "clang", CXX: "clang++"}
name: ${{matrix.config.name}}
runs-on: ${{matrix.config.os}}
steps:
- name: Install dependencies
env:
DEBIAN_FRONTEND: "noninteractive"
run: sudo apt-get update && sudo apt-get install -y build-essential cmake qtbase5-dev extra-cmake-modules lcov
- name: Checkout repository
uses: actions/checkout@v2
with:
submodules: recursive
- name: Configure
env:
CC: ${{matrix.config.CC}}
CXX: ${{matrix.config.CXX}}
BUILD_DIR: "build/"
run: |
cmake -B ${BUILD_DIR} -DBUILD_TESTING=ON -DBUILD_COVERAGE=ON -DBUILD_QML=OFF -DBUILD_KSYSTEMSTATS=OFF -DBUILD_KINFOCENTER=OFF
- name: Build
env:
CC: ${{matrix.config.CC}}
CXX: ${{matrix.config.CXX}}
BUILD_DIR: "build/"
run: |
MAKEFLAGS=-j$(nproc) cmake --build ${BUILD_DIR}
- name: XDG Base Dirs
run: |
mkdir -p "$HOME/.qttest/cache"
mkdir -p "$HOME/.qttest/config"
- name: Test
env:
CC: ${{matrix.config.CC}}
CXX: ${{matrix.config.CXX}}
BUILD_DIR: "build/"
run: |
ctest --test-dir ${BUILD_DIR} -V
- name: Generate Coverage Report
env:
CC: ${{matrix.config.CC}}
CXX: ${{matrix.config.CXX}}
BUILD_DIR: "build/"
run: |
lcov --capture --directory ${BUILD_DIR}src/lib --output-file ${BUILD_DIR}coverage.info
lcov --remove ${BUILD_DIR}coverage.info -o ${BUILD_DIR}coverage.info '/usr/*' '*/moc_*'
if: matrix.config.CC == 'gcc'
# TODO upload report somewhere, add a badge to the README, etc.
build-full:
strategy:
matrix:
config:
- {name: "Ubuntu 22.04 (GCC)", os: "ubuntu-22.04", CC: "gcc", CXX: "g++"}
#- {name: "Ubuntu 22.04 (Clang)", os: "ubuntu-22.04", CC: "clang", CXX: "clang++"}
name: ${{matrix.config.name}}
runs-on: ${{matrix.config.os}}
steps:
- name: Install dependencies
env:
DEBIAN_FRONTEND: "noninteractive"
run: sudo apt-get update && sudo apt-get install -y build-essential cmake qtbase5-dev qtdeclarative5-dev qtquickcontrols2-5-dev extra-cmake-modules libkf5coreaddons-dev libkf5declarative-dev libkf5sysguard-dev libsensors-dev
# TODO libsensors should be pulled in by KSystemStats...
- name: Checkout repository
uses: actions/checkout@v2
with:
submodules: recursive
- name: Configure
env:
CC: ${{matrix.config.CC}}
CXX: ${{matrix.config.CXX}}
BUILD_DIR: "build/"
run: |
cmake -B ${BUILD_DIR} -DBUILD_EXAMPLES=ON -DBUILD_TESTING=OFF
- name: Build
env:
CC: ${{matrix.config.CC}}
CXX: ${{matrix.config.CXX}}
BUILD_DIR: "build/"
run: |
MAKEFLAGS=-j$(nproc) cmake --build ${BUILD_DIR}
build-presentation:
strategy:
matrix:
config:
- {name: "Ubuntu 22.04 (GCC)", os: "ubuntu-22.04", CC: "gcc", CXX: "g++"}
#- {name: "Ubuntu 22.04 (Clang)", os: "ubuntu-22.04", CC: "clang", CXX: "clang++"}
name: ${{matrix.config.name}}
runs-on: ${{matrix.config.os}}
steps:
- name: Install dependencies
env:
DEBIAN_FRONTEND: "noninteractive"
run: sudo apt-get update && sudo apt-get install -y build-essential cmake qtbase5-dev qtdeclarative5-dev qtquickcontrols2-5-dev extra-cmake-modules libkf5coreaddons-dev libkf5declarative-dev libkf5sysguard-dev libsensors-dev
# TODO libsensors should be pulled in by KSystemStats...
- name: Checkout repository
uses: actions/checkout@v2
with:
submodules: recursive
- name: Configure
env:
CC: ${{matrix.config.CC}}
CXX: ${{matrix.config.CXX}}
BUILD_DIR: "build/"
run: |
cmake -B ${BUILD_DIR} -DBUILD_EXAMPLES=ON -DBUILD_TESTING=OFF -DPRESENTATION_BUILD=ON
- name: Build
env:
CC: ${{matrix.config.CC}}
CXX: ${{matrix.config.CXX}}
BUILD_DIR: "build/"
run: |
MAKEFLAGS=-j$(nproc) cmake --build ${BUILD_DIR}