Skip to content

Commit de61810

Browse files
committed
Improved GHA build-ci.yml (#156) and CMakeLists.txt for building with cmake (#155) - test all [ci]
1 parent 3df7541 commit de61810

File tree

2 files changed

+130
-85
lines changed

2 files changed

+130
-85
lines changed

.github/workflows/build-ci.yml

+74-38
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,20 @@
11
name: Build SocNetV (CI) 🚀
22
# run-name: ${{ github.actor }} testing latest SocNetV build with
33
on: [push]
4+
5+
6+
env:
7+
EXECUTABLE: "SocNetV"
8+
APPLICATION: "SocNetV"
9+
UNIXNAME: "SocNetV"
10+
QMAKE_PROJECT: "socnetv.pro"
11+
PUBLISHER: "Dimitris Kalamaras"
12+
QT_MODULES: "qtwebsockets qtimageformats qt5compat qtcharts qtdatavis3d qtwebview qt3d"
13+
QMAKE_CONFIG: debug
14+
CMAKE_CONFIG: Debug
15+
CORES: 16
16+
17+
418
jobs:
519
build:
620
strategy:
@@ -46,28 +60,28 @@ jobs:
4660
- if: contains( matrix.os, 'windows')
4761
name: Prepare for Windows
4862
run: |
49-
dir
63+
echo "🪟 -- Preparing for Windows..."
5064
# DONT NEED IT. FOR DEBUG ONLY
5165
# pip install aqtinstall
52-
# aqt list-qt linux desktop
5366
# aqt list-qt windows desktop
54-
# aqt list-qt mac desktop
5567
# aqt list-qt windows desktop --arch ${{ matrix.qt-version }}
5668
# aqt list-qt windows desktop --modules ${{ matrix.qt-version }} win64_mingw
5769
- if: contains( matrix.os, 'ubuntu')
5870
name: Install dependencies
5971
run: |
60-
ls
72+
echo "🐧 -- Preparing for ubuntu..."
73+
sudo apt install build-essential libssl-dev \
74+
cmake ninja-build \
75+
libssl-dev libxkbcommon-x11-dev libxcb-cursor-dev zlib1g-dev
76+
6177
# DONT NEED IT. FOR DEBUG ONLY
6278
# pip install aqtinstall
6379
# aqt list-qt linux desktop
6480
# aqt list-qt linux desktop --long-modules ${{ matrix.qt-version }} win64_mingw
65-
sudo apt install build-essential libssl-dev \
66-
cmake ninja-build \
67-
libssl-dev libxkbcommon-x11-dev libxcb-cursor-dev zlib1g-dev
6881
- if: contains( matrix.os, 'macos')
6982
name: Install for macOS
7083
run: |
84+
echo "🍎 -- Preparing for macos..."
7185
ls
7286
# DONT NEED IT. FOR DEBUG ONLY
7387
# pip install aqtinstall
@@ -87,7 +101,7 @@ jobs:
87101
with:
88102
aqtversion: '==2.0.0'
89103
version: ${{ matrix.qt-version }}
90-
# arch: win64_mingw
104+
# arch: win64_mingw # we build with msvc
91105
modules: qtwebsockets qtimageformats qt5compat qtcharts qtdatavis3d qtwebview qt3d
92106
cache: true
93107
- if: contains( matrix.os, 'windows') && startsWith( matrix.qt-version, '6.' ) && matrix.qt-version != '6.2.4'
@@ -96,7 +110,7 @@ jobs:
96110
with:
97111
aqtversion: '==2.1.*'
98112
version: ${{ matrix.qt-version }}
99-
#arch: win64_mingw
113+
#arch: win64_mingw # we build with msvc
100114
modules: qtwebsockets qtimageformats qt5compat qtcharts qtdatavis3d qtwebview qt3d
101115
cache: true
102116
- if: contains( matrix.os, 'ubuntu') && startsWith( matrix.qt-version, '6.' )
@@ -120,71 +134,93 @@ jobs:
120134
#
121135
# Build SocNetV
122136
#
137+
- if: contains( matrix.os, 'ubuntu-22.04')
138+
name: Build for Linux
139+
run: |
140+
echo "🔎 Check openssl version:"
141+
echo `openssl version`
142+
echo "🔎 Check output of 'which qmake6':"
143+
which qmake6
144+
echo "🔎 Check qmake6 version:"
145+
qmake6 -v
146+
echo "🔧 Running qmake on ubuntu 22.04..."
147+
qmake6 CONFIG+=${{env.QMAKE_CONFIG}}
148+
echo "🚧 🛠️ Compiling for linux with make. Please wait..."
149+
make -j${{env.CORES}}
150+
echo "👉 Building finished. Listing current directory with find for verification:"
151+
find .
123152
- if: contains( matrix.os, 'ubuntu-latest')
124153
name: Build for Linux
125154
run: |
126-
echo "openssl version:"
155+
echo "🔎 Check openssl version:"
127156
echo `openssl version`
128-
echo "Check output of 'which qmake6':"
157+
echo "🔎 Check output of 'which qmake6':"
129158
which qmake6
130-
echo "Check qmake6 -v:"
159+
echo "🔎 Check qmake6 version:"
131160
qmake6 -v
132-
qmake6 CONFIG+=debug && make -s -j 8
133-
echo "Building finished! "
134-
echo "Files in current directory: "
161+
echo "🔧 Running qmake on ubuntu..."
162+
qmake6 CONFIG+=${{env.QMAKE_CONFIG}}
163+
echo "🚧 🛠️ Compiling for linux with make. Please wait..."
164+
make
165+
echo "👉 Building finished. Listing current directory with find for verification:"
135166
find .
136167
# BUILD FOR MACOS
137168
- if: contains( matrix.os, 'macos')
138169
name: Build for macOS
139170
run: |
140-
qmake CONFIG+=debug socnetv.pro
141-
make -s -j 8
171+
echo "🔧 Running qmake on macos..."
172+
qmake CONFIG+=${{env.QMAKE_CONFIG}} ${{env.QMAKE_PROJECT}}
173+
echo "🚧 🛠️ Compiling for macos with make. Please wait..."
174+
make
175+
echo "👉 Building finished. Listing current directory with find for verification:"
142176
find .
143177
# BUILD FOR WINDOWS
144178
- if: contains( matrix.os, 'windows') && startsWith( matrix.qt-version, '6.' ) && matrix.qt-version == '6.2.4'
145179
name: Build for Windows
146180
run: |
147-
echo "Listing some directories"
181+
echo "🔎 Listing some directories"
148182
dir D:\a\app\Qt\
149-
echo "Running qmake6"
150-
qmake6 CONFIG+=debug socnetv.pro -r
151-
echo "Compiling, please wait..."
183+
echo "🔧 Running qmake6"
184+
qmake6 CONFIG+=${{env.QMAKE_CONFIG}} ${{env.QMAKE_PROJECT}} -r
185+
echo "🚧 🛠️ Compiling with nmake. Please wait..."
152186
nmake
187+
echo "👉 Building finished. Listing current directory for verification:"
153188
dir
154189
- if: contains( matrix.os, 'windows') && startsWith( matrix.qt-version, '6.' ) && matrix.qt-version == '6.4.3'
155190
name: Build for Windows
156191
run: |
157-
echo "Listing some directories"
192+
echo "🔎 Listing some directories"
158193
dir D:\a\app\Qt\
159-
echo "Running qmake6"
160-
qmake6 CONFIG+=debug socnetv.pro -r
161-
echo "Compiling with nmake. Please wait..."
194+
echo "🔧 Running qmake6"
195+
qmake6 CONFIG+=${{env.QMAKE_CONFIG}} ${{env.QMAKE_PROJECT}} -r
196+
echo "🚧 🛠️ Compiling with nmake. Please wait..."
162197
nmake
198+
echo "👉 Building finished. Listing current directory for verification:"
163199
dir
164200
- if: contains( matrix.os, 'windows') && startsWith( matrix.qt-version, '6.' ) && matrix.qt-version == '6.5.3'
165201
name: Build for Windows
166202
run: |
167-
echo "Listing some directories"
203+
echo "🔎 Listing some directories"
168204
dir D:\a\app\Qt\
169-
echo "Creating build dir"
205+
echo "💡 Creating build dir"
170206
mkdir build
171-
echo "Running cmake ..."
207+
echo "🔧 Running cmake""
172208
cmake -S . -B build
173-
echo "Compiling with cmake at once. Please wait..."
174-
cmake --build build
209+
echo "🚧 🛠️ Compiling into build/ with cmake --build. Please wait..."
210+
cmake --build build ${{env.CMAKE_CONFIG}}
211+
echo "👉 Building finished. Listing directory build/ for verification:"
175212
dir build
176213
- if: contains( matrix.os, 'windows') && startsWith( matrix.qt-version, '6.' ) && matrix.qt-version == '6.6.3'
177214
name: Build for Windows
178215
run: |
179-
echo "Listing some directories"
216+
echo "🔎 Listing some directories"
180217
dir D:\a\app\Qt\
181-
echo "Creating build dir"
218+
echo "💡 Creating build dir"
182219
mkdir build
183-
echo "Entering build dir"
184-
cd build
185-
echo "Running cmake"
186-
cmake ..
187-
echo "Compiling with nmake. Please wait..."
188-
nmake
220+
echo "🔧 Running cmake"
221+
cmake -S . -B build
222+
echo "🚧 🛠️ Compiling into build/ with cmake --build. Please wait..."
223+
cmake --build build --config ${{env.CMAKE_CONFIG}}
224+
echo "👉 Building finished. Listing directory build/ for verification:"
189225
dir build
190226
- run: echo "🍏 This job's status is ${{ job.status }}."

0 commit comments

Comments
 (0)