-
Notifications
You must be signed in to change notification settings - Fork 26
255 lines (234 loc) · 11.1 KB
/
build-ci.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
# GitHub Action to CI build SocNetV for all 3 major OSes
# Triggered only when the commit message contains [gha] or [ci]
name: Build SocNetV (CI) 🚀
on:
push:
branches:
- develop
env:
EXECUTABLE: "SocNetV"
APPLICATION: "SocNetV"
UNIXNAME: "SocNetV"
QMAKE_PROJECT: "socnetv.pro"
PUBLISHER: "Dimitris Kalamaras"
QT_MODULES: "qtwebsockets qtimageformats qt5compat qtcharts qtdatavis3d qtwebview qt3d"
QMAKE_CONFIG: debug
CMAKE_CONFIG: Debug
CORES: 16
jobs:
ci_build:
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, ubuntu-latest, macos-latest, windows-2019]
# NOTE:
# - We will CI build only for Qt6 LTS releases, see: https://doc.qt.io/qt-6/qt-releases.html
# - For the Qt Versions supported by aqtinstall, see: https://ddalcino.github.io/aqt-list-server/
qt-version: ['6.2.4', '6.5.3', '6.6.3', '6.8.0']
# exclude:
# - os: ubuntu-latest
# qt-version: '6.5.3'
# - os: windows-2019
# qt-version: '6.5.3'
# - os: macos-latest
# qt-version: '6.5.3'
# include:
# - os: macos-latest
# qt-version: '6.6.3'
# # Snapcraft
# - os: ubuntu-22.04
# qt-version: '6.5.3'
runs-on: ${{ matrix.os }}
if: contains(github.event.head_commit.message, '[ci]') || contains(github.event.head_commit.message, '[gha]')
steps:
- name: 🤖 Job information
run: |
echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event, by actor ${{ github.actor }}."
echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!"
echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
- name: 📂 Check out repository ${{ github.repository }}
uses: actions/checkout@v4
- name: 💡 List files cloned from the ${{ github.repository }}
run: |
ls ${{ github.workspace }}
echo "💡 The ${{ github.repository }} repository has been cloned to the runner."
echo "🖥️ The workflow is now ready to test your code on the runner."
#
# Install Qt
#
- if: contains( matrix.os, 'windows')
name: Prepare for ${{matrix.os}}
run: |
echo "🪟 -- Preparing for Windows..."
# DONT NEED IT. FOR DEBUG ONLY
# pip install aqtinstall
# aqt list-qt windows desktop
# aqt list-qt windows desktop --arch ${{ matrix.qt-version }}
# aqt list-qt windows desktop --modules ${{ matrix.qt-version }} win64_mingw
- if: contains( matrix.os, 'ubuntu')
name: Prepare for ${{matrix.os}}
run: |
echo "🐧 -- Preparing for ubuntu..."
sudo apt install build-essential libssl-dev \
cmake ninja-build \
libssl-dev libxkbcommon-x11-dev libxcb-cursor-dev zlib1g-dev
# DONT NEED IT. FOR DEBUG ONLY
# pip install aqtinstall
# aqt list-qt linux desktop
# aqt list-qt linux desktop --long-modules ${{ matrix.qt-version }} win64_mingw
- if: contains( matrix.os, 'macos')
name: Prepare for ${{matrix.os}}
run: |
echo "🍎 -- Preparing for macos..."
ls
# DONT NEED IT. FOR DEBUG ONLY
# pip install aqtinstall
# aqt list-qt mac desktop
# aqt list-qt mac desktop --modules ${{ matrix.qt-version }}
#
# Install Qt (using https://github.com/jurplel/install-qt-action)
#
- if: contains( matrix.os, 'windows')
name: Make sure MSVC is found
uses: ilammy/msvc-dev-cmd@v1
- if: contains( matrix.os, 'windows') && startsWith( matrix.qt-version, '6.' )
name: Install Qt ${{ matrix.qt-version }} on ${{ matrix.os }}
uses: jurplel/install-qt-action@v4
with:
aqtversion: '==3.1.*' # Use the default aqtinstall version
version: ${{ matrix.qt-version }} # Qt version to install
# arch: win64_mingw
# NOTE: We build with default arch:
# win64_msvc2019_64 if Qt < 6.8
# win64_msvc2022_64 if Qt >= 6.8
# see https://github.com/jurplel/install-qt-action
modules: ${{env.QT_MODULES}}
cache: true
- if: contains( matrix.os, 'ubuntu') && startsWith( matrix.qt-version, '6.' )
name: Install Qt 6 on ${{ matrix.os }}
uses: jurplel/install-qt-action@v4
with:
aqtversion: '==3.1.*' # Use the default aqtinstall version
version: ${{ matrix.qt-version }} # Qt version to install
modules: ${{env.QT_MODULES}}
cache: true
- if: contains( matrix.os, 'macos') && startsWith( matrix.qt-version, '6.' )
name: Install Qt 6 on macOS
uses: jurplel/install-qt-action@v4
with:
aqtversion: '==3.1.*' # Use the default aqtinstall version
version: ${{ matrix.qt-version }}
modules: ${{env.QT_MODULES}}
cache: true
#
# Build SocNetV
#
- if: contains( matrix.os, 'ubuntu-22.04')
name: Build for ${{matrix.os}} with Qt${{matrix.qt-version}}
run: |
echo '⚙️ Install dependencies'
sudo apt install desktop-file-utils
echo "🔎 Check openssl version:"
echo `openssl version`
echo "🔎 Check output of 'which qmake6':"
which qmake6
echo "🔎 Check qmake6 version:"
qmake6 -v
echo "🔧 Running qmake on ubuntu 22.04 with ${{env.QMAKE_CONFIG}}..."
qmake6 CONFIG+=${{env.QMAKE_CONFIG}}
echo "🚧 🛠️ Compiling for linux with make -j${{env.CORES}}. Please wait..."
make -j${{env.CORES}}
echo "👉 Building finished. Listing current directory with find for verification:"
find .
- if: contains( matrix.os, 'ubuntu-latest')
name: Build for ${{matrix.os}} with Qt ${{matrix.qt-version}}
run: |
echo "🔧 Installing dependencies for AppImage creation..."
sudo apt update
sudo apt install -y build-essential libssl-dev cmake ninja-build \
libssl-dev libxkbcommon-x11-dev libxcb-cursor-dev zlib1g-dev \
desktop-file-utils patchelf libglu1-mesa-dev libfontconfig1 libfreetype6 libx11-dev libxext-dev \
libxrandr-dev libxrender-dev libxcb1-dev libx11-xcb-dev libxcb-glx0-dev
echo "🔎 Check openssl version:"
echo `openssl version`
echo "🔧 Installing linuxdeployqt..."
wget https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage
chmod a+x linuxdeployqt-continuous-x86_64.AppImage
echo "💡 Creating build directory..."
mkdir build && cd build
echo "🔧 Configuring project using cmake..."
cmake .. -DCMAKE_BUILD_TYPE=${{env.CMAKE_CONFIG}}
echo "🚧 Compiling the project..."
cmake --build . -- -j${{env.CORES}}
echo "🔎 Verifying built files..."
find . -type f -name "${{env.EXECUTABLE}}*"
echo "🔧 Installing the application into AppDir..."
mkdir AppDir
make install DESTDIR=AppDir
echo "🚀 Creating the AppImage using linuxdeployqt..."
./linuxdeployqt-continuous-x86_64.AppImage AppDir/usr/share/applications/*.desktop \
-appimage -extra-plugins=iconengines,imageformats
echo "🎉 AppImage created! Listing files in current directory..."
ls -lh ./*.AppImage
# BUILD FOR MACOS
- if: contains( matrix.os, 'macos')
name: Build for ${{matrix.os}} with Qt ${{matrix.qt-version}}
run: |
echo "🔧 Running 'qmake CONFIG+=${{env.QMAKE_CONFIG}} ${{env.QMAKE_PROJECT}}' to configure on macos..."
qmake CONFIG+=${{env.QMAKE_CONFIG}} ${{env.QMAKE_PROJECT}}
echo "🚧 🛠️ Compiling for macos with make. Please wait..."
make
echo "👉 Building finished. Listing current directory with find for verification:"
find .
# BUILD FOR WINDOWS
- if: contains( matrix.os, 'windows') && startsWith( matrix.qt-version, '6.' ) && matrix.qt-version == '6.2.4'
name: Build for ${{matrix.os}} with Qt ${{matrix.qt-version}}
run: |
echo "🔎 Listing some directories"
dir D:\a\app\Qt\
echo "🔧 Running 'qmake6 CONFIG+=${{env.QMAKE_CONFIG}} ${{env.QMAKE_PROJECT}} -r' to configure the project on Windows..."
qmake6 CONFIG+=${{env.QMAKE_CONFIG}} ${{env.QMAKE_PROJECT}} -r
echo "🚧 🛠️ Compiling with nmake. Please wait..."
nmake
echo "👉 Building finished. Listing current directory for verification:"
dir
- if: contains( matrix.os, 'windows') && startsWith( matrix.qt-version, '6.' ) && matrix.qt-version == '6.5.3'
name: Build for ${{matrix.os}} with Qt ${{matrix.qt-version}}
run: |
echo "🔎 Listing some directories"
dir D:\a\app\Qt\
echo "💡 Creating build dir"
mkdir build
echo "🔧 Running 'cmake -S . -B build' to configure the project..."
cmake -S . -B build
echo "🚧 🛠️ Compiling into build/ with 'cmake --build build -j${{env.CORES}} --config ${{env.CMAKE_CONFIG}}'. Please wait..."
cmake --build build -j${{env.CORES}} --config ${{env.CMAKE_CONFIG}}
echo "👉 Building finished. Listing directory build/ for verification: "
dir build
- if: contains( matrix.os, 'windows') && startsWith( matrix.qt-version, '6.' ) && matrix.qt-version == '6.6.3'
name: Build for ${{matrix.os}} with Qt ${{matrix.qt-version}}
run: |
echo "🔎 Listing some directories"
dir D:\a\app\Qt\
echo "💡 Creating build dir"
mkdir build
echo "🔧 Running 'cmake -S . -B build' to configure the project..."
cmake -S . -B build
echo "🚧 🛠️ Compiling into build/ with 'cmake --build build -j${{env.CORES}} --config ${{env.CMAKE_CONFIG}}'. Please wait..."
cmake --build build -j${{env.CORES}} --config ${{env.CMAKE_CONFIG}}
echo "👉 Building finished. Listing directory build/ for verification: "
dir build
- if: contains( matrix.os, 'windows') && startsWith( matrix.qt-version, '6.' ) && matrix.qt-version == '6.8.0'
name: Build for ${{matrix.os}} with Qt ${{matrix.qt-version}}
run: |
echo "🔎 Listing some directories"
dir D:\a\app\Qt\
echo "💡 Creating build dir"
mkdir build
echo "🔧 Running 'cmake -S . -B build' to configure the project..."
cmake -S . -B build
echo "🚧 🛠️ Compiling into build/ with 'cmake --build build -j${{env.CORES}} --config ${{env.CMAKE_CONFIG}}'. Please wait..."
cmake --build build -j${{env.CORES}} --config ${{env.CMAKE_CONFIG}} -v
echo "👉 Building finished. Listing directory build/ for verification: "
dir build
- run: echo "🍏 This job's status is ${{ job.status }}."