-
Notifications
You must be signed in to change notification settings - Fork 86
259 lines (232 loc) · 8.55 KB
/
cmake.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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
# Heavily inspired (i.e. copy/paste) from https://gist.github.com/NickNaso/0d478f1481686d5bcc868cac06620a60
name: CMake Build Matrix
# Controls when the action will run. Triggers the workflow on push
on:
push:
pull_request:
release:
# tags:
# - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- {
name: "Ubuntu-latest GCC NoGui",
os: ubuntu-latest,
build_type: "Debug",
cc: "gcc",
cxx: "g++"
}
- {
name: "Ubuntu-latest GCC Qt6",
os: ubuntu-latest,
build_type: "Debug",
cc: "gcc",
cxx: "g++",
}
- {
name: "Ubuntu-latest GCC Qt5",
os: ubuntu-latest,
build_type: "Debug",
cc: "gcc",
cxx: "g++",
}
- {
name: "Ubuntu 20.04 GCC Qt5",
os: ubuntu-20.04,
build_type: "Debug",
cc: "gcc",
cxx: "g++"
}
- {
name: "macOS Clang Qt6",
os: macos-latest,
build_type: "Debug",
cc: "clang",
cxx: "clang++"
}
- {
name: "macOS Clang Qt5",
os: macos-latest,
build_type: "Debug",
cc: "clang",
cxx: "clang++"
}
- {
name: "Windows MinGW Qt6",
os: windows-latest,
build_type: "Debug",
cc: "gcc",
cxx: "g++"
}
- {
name: "Windows MinGW Qt5",
os: windows-latest,
build_type: "Debug",
cc: "gcc",
cxx: "g++"
}
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- name: Print env
run: |
echo github.event.action: ${{ github.event.action }}
echo github.event_name: ${{ github.event_name }}
- name: Install common dependencies on all Ubuntu
if: "startsWith(matrix.config.name, 'Ubuntu')"
run: |
sudo apt-get update
sudo apt-get install build-essential g++ git cmake ninja-build sqlite3 libsqlite3-dev cscope exuberant-ctags
uname -a
lsb_release -a
gcc -v && g++ -v && cmake --version && ninja --version
- name: Install dependencies on Ubuntu-latest GCC Qt6
if: "startsWith(matrix.config.name, 'Ubuntu-latest GCC Qt6')"
run: |
sudo apt-get install libglx-dev libgl1-mesa-dev libvulkan-dev libxkbcommon-dev
sudo apt-get install qt6-base-dev qt6-base-dev-tools qt6-tools-dev qt6-tools-dev-tools
sudo apt-get install libqt6core5compat6-dev qt6-l10n-tools qt6-wayland
- name: Install dependencies on Ubuntu-latest GCC Qt5
if: "startsWith(matrix.config.name, 'Ubuntu-latest GCC Qt5')"
run: |
sudo apt-get install qtcreator qtbase5-dev qt5-qmake qttools5-dev-tools qttools5-dev
- name: Install dependencies on Ubuntu 20.04 GCC Qt5
if: "startsWith(matrix.config.name, 'Ubuntu 20.04 GCC Qt5')"
run: |
sudo apt-get install qt5-default qttools5-dev-tools qttools5-dev
- name: Install dependencies on macOS Clang Qt6
if: startsWith(matrix.config.name, 'macOS Clang Qt6')
run: |
brew install cmake ninja qt@6 sqlite cscope ctags vulkan-headers
clang -v
cmake --version
ninja --version
brew info qt@6
- name: Install dependencies on macOS Clang Qt5
if: startsWith(matrix.config.name, 'macOS Clang Qt5')
run: |
brew install cmake ninja qt@5 sqlite cscope ctags
clang -v
cmake --version
ninja --version
brew info qt@5
- name: Install Qt6 on Windows
if: startsWith(matrix.config.name, 'Windows MinGW Qt6')
uses: jurplel/install-qt-action@v4
with:
version: '6.7.*'
host: 'windows'
target: 'desktop'
arch: 'win64_mingw'
modules: 'qt5compat'
cache: 'false'
- name: Install Qt5 on Windows
if: startsWith(matrix.config.name, 'Windows MinGW Qt5')
uses: jurplel/install-qt-action@v4
with:
version: '5.15.2'
host: 'windows'
target: 'desktop'
arch: 'win64_mingw81'
cache: 'false'
- name: Install sqlite3 on Windows
shell: cmd
if: startsWith(matrix.config.name, 'Windows MinGW')
run: vcpkg install sqlite3:x64-windows
- name: Install ninja on Windows
if: startsWith(matrix.config.name, 'Windows MinGW')
uses: seanmiddleditch/gha-setup-ninja@master
- name: Configure CMake and Build on Ubuntu GCC Qt6
shell: bash
if: "contains(matrix.config.name, 'Ubuntu-latest GCC Qt6')"
run: |
export CC=gcc
export CXX=g++
cmake -G Ninja -S . -B build
cmake --build build
sudo cmake --install build
- name: Configure CMake and Build on Ubuntu GCC Qt5
shell: bash
if: "contains(matrix.config.name, 'Ubuntu-latest GCC Qt5') || contains(matrix.config.name, 'Ubuntu 20.04 GCC Qt5')"
run: |
export CC=gcc
export CXX=g++
cmake -G Ninja -DBUILD_QT5=ON -S . -B build
cmake --build build
sudo cmake --install build
- name: Configure CMake and Build on Ubuntu-latest GCC NoGui
shell: bash
if: contains(matrix.config.name, 'Ubuntu-latest GCC NoGui')
run: |
export CC=gcc
export CXX=g++
cmake -G Ninja -DNO_GUI=ON -S . -B build
cmake --build build
sudo cmake --install build
- name: Configure CMake and Build on macOS Clang Qt6
shell: bash
if: contains(matrix.config.name, 'macOS Clang Qt6')
run: |
export CC=clang
export CXX=clang++
cmake -G Ninja -DCMAKE_PREFIX_PATH=/usr/local/opt/qt@6/lib/cmake -S . -B build
cmake --build build
sudo cmake --install build
- name: Configure CMake and Build on macOS Clang Qt5
shell: bash
if: contains(matrix.config.name, 'macOS Clang Qt5')
run: |
export CC=clang
export CXX=clang++
cmake -G Ninja -DBUILD_QT5=ON -DCMAKE_PREFIX_PATH=/opt/homebrew/opt/qt@5/lib/cmake -S . -B build
cmake --build build
sudo cmake --install build
- name: Configure CMake and Build on Windows MinGW Qt6
shell: cmd
if: contains(matrix.config.name, 'Windows MinGW Qt6')
run: call "windows-install/qt6/buildqt6_github.bat"
- name: Configure CMake and Build on Windows MinGW Qt5
shell: cmd
if: contains(matrix.config.name, 'Windows MinGW Qt5')
run: call "windows-install/qt5/buildqt5_github.bat"
- name: Test on Linux, MacOS
shell: bash
if: ${{ !contains(matrix.config.name, 'Windows MinGW') }}
run: |
find . -name "*.h" > cscope.files
find . -name "*.c" >> cscope.files
find . -name "*.cpp" >> cscope.files
find . -name "*.cxx" >> cscope.files
cqmakedb -v
cscope -cb
ctags --fields=+i -n -L cscope.files
cqmakedb -s cq.db -c cscope.out -t tags -p -d
cqsearch -s cq.db -p 1 -t CODEQUERY_SW_VERSION -u
cscope -b -f cscope1.out
cqmakedb -s cq1.db -c cscope1.out -t tags -p -d
cqsearch -s cq1.db -p 1 -t CODEQUERY_SW_VERSION -u
- name: Test on Windows Qt6
shell: cmd
if: contains(matrix.config.name, 'Windows MinGW Qt6')
run: call "windows-install/qt6/testqt6_github.bat"
- name: Test on Windows Qt5
shell: cmd
if: contains(matrix.config.name, 'Windows MinGW Qt5')
run: call "windows-install/qt5/testqt5_github.bat"
- name: Pack on Windows Qt6
shell: cmd
if: contains(matrix.config.name, 'Windows MinGW Qt6')
run: call "windows-install/qt6/packqt6_github.bat"
- name: Pack on Windows Qt5
shell: cmd
if: contains(matrix.config.name, 'Windows MinGW Qt5')
run: call "windows-install/qt5/packqt5_github.bat"