-
Notifications
You must be signed in to change notification settings - Fork 631
408 lines (397 loc) · 15.8 KB
/
main.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
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
name: CI/CD
on:
push:
pull_request:
workflow_dispatch:
release:
types: [published]
jobs:
# Release builds
build_release_macos:
name: Release build (macOS universal, static Qt 6.5.0)
runs-on: macos-12
steps:
- uses: actions/checkout@v3
- name: Get Qt
uses: actions/checkout@v3
with:
repository: LongSoft/qt-6-static-universal-macos
path: qt
lfs: true
- name: Unpack Qt
shell: bash
working-directory: qt
run: sudo 7z x qt-6.5.0-static-universal-macos.7z -o/opt
- name: Create build directory
run: cmake -E make_directory ${{runner.workspace}}/build
- name: Configure everything
working-directory: ${{runner.workspace}}/build
run: cmake -DCMAKE_PREFIX_PATH="/opt/qt-6.5.0-static-universal-macos" -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" -DCMAKE_OSX_DEPLOYMENT_TARGET="11.0" ../UEFITool
- name: Build everything
working-directory: ${{runner.workspace}}/build
shell: bash
run: cmake --build . --config Release
- name: Create dist directory
run: cmake -E make_directory ${{runner.workspace}}/UEFITool/dist
- name: Archive everything
working-directory: ${{runner.workspace}}/build
shell: bash
run: |
UEFITOOL_VER=$(cat ../UEFITool/version.h | grep PROGRAM_VERSION | cut -d'"' -f2 | sed 's/NE alpha /A/') ; \
zip -qryj ../UEFITool/dist/UEFIExtract_NE_${UEFITOOL_VER}_universal_mac.zip ./UEFIExtract/UEFIExtract
zip -qryj ../UEFITool/dist/UEFIFind_NE_${UEFITOOL_VER}_universal_mac.zip ./UEFIFind/UEFIFind
cd UEFITool
zip -qry ../../UEFITool/dist/UEFITool_NE_${UEFITOOL_VER}_universal_mac.zip ./UEFITool.app
- name: Upload to artifacts
uses: actions/upload-artifact@v3
with:
name: macOS builds
path: dist/*.zip
- name: Upload to releases
if: github.event_name == 'release'
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: dist/*.zip
tag: ${{ github.ref }}
file_glob: true
build_release_linux:
name: Release build (Linux x64, shared Qt 6)
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Get Qt
run: |
sudo apt update
sudo apt-get install -qq zip cmake libgl1-mesa-dev qt6-base-dev
- name: Create build directory
run: cmake -E make_directory ${{runner.workspace}}/build
- name: Configure everything
working-directory: ${{runner.workspace}}/build
run: cmake ../UEFITool
- name: Build everything
working-directory: ${{runner.workspace}}/build
shell: bash
run: cmake --build . --config Release
- name: Create dist directory
run: cmake -E make_directory ${{runner.workspace}}/UEFITool/dist
- name: Archive everything
working-directory: ${{runner.workspace}}/build
shell: bash
run: |
UEFITOOL_VER=$(cat ../UEFITool/version.h | grep PROGRAM_VERSION | cut -d'"' -f2 | sed 's/NE alpha /A/') ; \
zip -qryj ../UEFITool/dist/UEFIExtract_NE_${UEFITOOL_VER}_x64_linux.zip ./UEFIExtract/uefiextract
zip -qryj ../UEFITool/dist/UEFIFind_NE_${UEFITOOL_VER}_x64_linux.zip ./UEFIFind/uefifind
zip -qryj ../UEFITool/dist/UEFITool_NE_${UEFITOOL_VER}_x64_linux.zip ./UEFITool/uefitool
- name: Upload to artifacts
uses: actions/upload-artifact@v3
with:
name: Linux builds
path: dist/*.zip
- name: Upload to releases
if: github.event_name == 'release'
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: dist/*.zip
tag: ${{ github.ref }}
file_glob: true
build_release_freebsd:
name: Release build (FreeBSD x64, shared Qt 6)
runs-on: macos-12
steps:
- uses: actions/checkout@v3
- name: Build on FreeBSD inside macOS VM
id: test
uses: cross-platform-actions/[email protected]
with:
operating_system: freebsd
version: '13.1'
shell: sh
run: |
sudo pkg install -y zip cmake qt6-base
mkdir dist
mkdir build
cd build
cmake ..
cmake --build . --config Release
UEFITOOL_VER=$(cat ../version.h | grep PROGRAM_VERSION | cut -d'"' -f2 | sed 's/NE alpha /A/') ; \
zip -qryj ../dist/UEFIExtract_NE_${UEFITOOL_VER}_x64_freebsd.zip ./UEFIExtract/uefiextract
zip -qryj ../dist/UEFIFind_NE_${UEFITOOL_VER}_x64_freebsd.zip ./UEFIFind/uefifind
zip -qryj ../dist/UEFITool_NE_${UEFITOOL_VER}_x64_freebsd.zip ./UEFITool/uefitool
- name: Upload to artifacts
uses: actions/upload-artifact@v3
with:
name: FreeBSD builds
path: dist/*.zip
- name: Upload to releases
if: github.event_name == 'release'
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: dist/*.zip
tag: ${{ github.ref }}
file_glob: true
build_release_windows_32:
name: Release build (Win32, static Qt 5.6.3)
runs-on: windows-2019
steps:
- uses: actions/checkout@v3
- name: Get Qt 5.6.3
uses: actions/checkout@v3
with:
repository: LongSoft/qt-5.6.3-static-x86-msvc2017
path: qt5
lfs: true
- name: Unpack Qt 5.6.3
shell: bash
working-directory: qt5
run: 7z x qt-5.6.3-static-x86-msvc2017.7z -o../..
- name: Create dist directory
shell: bash
run: mkdir dist
- name: Create UEFIExtract build directory
run: cmake -E make_directory ${{runner.workspace}}/build/UEFIExtract
- name: Configure UEFIExtract
shell: bash
working-directory: ${{runner.workspace}}/build/UEFIExtract
run: cmake -G "Visual Studio 16 2019" -A Win32 -T "v141_xp" -DCMAKE_MSVC_RUNTIME_LIBRARY="MultiThreaded" ../../UEFITool/UEFIExtract/
- name: Build UEFIExtract
working-directory: ${{runner.workspace}}/build/UEFIExtract
shell: bash
run: cmake --build . --config Release
- name: Archive UEFIExtract
working-directory: ${{runner.workspace}}/build/UEFIExtract/Release
shell: bash
run: |
UEFITOOL_VER=$(cat ../../../UEFITool/version.h | grep PROGRAM_VERSION | cut -d'"' -f2 | sed 's/NE alpha /A/') ; \
7z a ../../../UEFITool/dist/UEFIExtract_NE_${UEFITOOL_VER}_win32.zip UEFIExtract.exe
- name: Create UEFIFind build directory
run: cmake -E make_directory ${{runner.workspace}}/build/UEFIFind
- name: Configure UEFIFind
working-directory: ${{runner.workspace}}/build/UEFIFind
shell: bash
run: cmake -G "Visual Studio 16 2019" -A Win32 -T "v141_xp" -DCMAKE_MSVC_RUNTIME_LIBRARY="MultiThreaded" ../../UEFITool/UEFIFind/
- name: Build UEFIFind
working-directory: ${{runner.workspace}}/build/UEFIFind
shell: bash
run: cmake --build . --config Release
- name: Archive UEFIFind
working-directory: ${{runner.workspace}}/build/UEFIFind/Release
shell: bash
run: |
UEFITOOL_VER=$(cat ../../../UEFITool/version.h | grep PROGRAM_VERSION | cut -d'"' -f2 | sed 's/NE alpha /A/') ; \
7z a ../../../UEFITool/dist/UEFIFind_NE_${UEFITOOL_VER}_win32.zip UEFIFind.exe
- name: Create UEFITool build directory
run: cmake -E make_directory ${{runner.workspace}}/build/UEFITool
- name: Configure UEFITool
shell: bash
working-directory: ${{runner.workspace}}/build/UEFITool
run: ../../qt-5.6.3-static-x86-msvc2017/bin/qmake.exe -tp vc ../../UEFITool/UEFITool/
- name: Build UEFITool
working-directory: ${{runner.workspace}}/build/UEFITool
shell: cmd
run: |
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars32.bat"
msbuild -t:Rebuild -p:PlatformToolset=v141_xp;Configuration=Release
- name: Archive UEFITool
working-directory: ${{runner.workspace}}/build/UEFITool/release
shell: bash
run: |
UEFITOOL_VER=$(cat ../../../UEFITool/version.h | grep PROGRAM_VERSION | cut -d'"' -f2 | sed 's/NE alpha /A/') ; \
7z a ../../../UEFITool/dist/UEFITool_NE_${UEFITOOL_VER}_win32.zip UEFITool.exe
- name: Upload to artifacts
uses: actions/upload-artifact@v3
with:
name: Windows 32-bit builds
path: dist/*.zip
- name: Upload to releases
if: github.event_name == 'release'
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: dist/*.zip
tag: ${{ github.ref }}
file_glob: true
build_release_windows_64:
name: Release build (Win64, static Qt 6.5.0)
runs-on: windows-2022
steps:
- uses: actions/checkout@v3
- name: Get Qt 6.5.0
uses: actions/checkout@v3
with:
repository: LongSoft/qt-6-static-x64-msvc2022
path: qt6
lfs: true
- name: Unpack Qt 6.5.0
shell: bash
working-directory: qt6
run: 7z x qt-6.5.0-static-x64-msvc2022.7z -o../..
- name: Create build directory
run: cmake -E make_directory ${{runner.workspace}}/build
- name: Configure everything
working-directory: ${{runner.workspace}}/build
shell: cmd
run: cmake -DCMAKE_PREFIX_PATH="D:\a\UEFITool\qt-6.5.0-static-x64-msvc2022" -DCMAKE_MSVC_RUNTIME_LIBRARY="MultiThreaded" -A x64 ../UEFITool
- name: Build everything
working-directory: ${{runner.workspace}}/build
shell: bash
run: cmake --build . --config Release
- name: Create dist directory
run: cmake -E make_directory ${{runner.workspace}}/UEFITool/dist
- name: Archive everything
working-directory: ${{runner.workspace}}/build
shell: bash
run: |
UEFITOOL_VER=$(cat ../UEFITool/version.h | grep PROGRAM_VERSION | cut -d'"' -f2 | sed 's/NE alpha /A/') ; \
7z a ../UEFITool/dist/UEFIExtract_NE_${UEFITOOL_VER}_win64.zip ./UEFIExtract/Release/UEFIExtract.exe
7z a ../UEFITool/dist/UEFIFind_NE_${UEFITOOL_VER}_win64.zip ./UEFIFind/Release/UEFIFind.exe
7z a ../UEFITool/dist/UEFITool_NE_${UEFITOOL_VER}_win64.zip ./UEFITool/Release/UEFITool.exe
- name: Upload to artifacts
uses: actions/upload-artifact@v3
with:
name: Windows 64-bit builds
path: dist/*.zip
- name: Upload to releases
if: github.event_name == 'release'
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: dist/*.zip
tag: ${{ github.ref }}
file_glob: true
# Build Tests
build_test_linux_meson:
name: Meson build system test (shared Qt 5)
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Get Deps
run: |
sudo apt update
sudo apt-get install -qq cmake meson zlib1g-dev qtbase5-dev
- name: Configure build
run: mkdir build-meson && meson ./build-meson
- name: Build everything
run: ninja -C build-meson
build_test_windows_mingw:
name: MinGW compiler test (shared Qt 6.5.0)
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
version: '6.5.0'
host: 'windows'
target: 'desktop'
arch: 'win64_mingw'
- name: Build everything
run: |
cmake -G "MinGW Makefiles" -B build .
cmake --build build --parallel
# Static Analysis
build_analyze_linux_coverity:
env:
PROJECT_TYPE: TOOL
JOB_TYPE: COVERITY
if: github.repository_owner == 'LongSoft' && github.event_name != 'pull_request'
name: Coverity Static Analysis (shared Qt 6.5.0)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
version: '6.5.0'
host: 'linux'
target: 'desktop'
- name: Create build directory
run: cmake -E make_directory ${{runner.workspace}}/build
- name: Configure everything
working-directory: ${{runner.workspace}}/build
run: cmake ../UEFITool
- name: Run Coverity
working-directory: ${{runner.workspace}}/build
run: |
src=$(/usr/bin/curl -Lfs https://raw.githubusercontent.com/acidanthera/ocbuild/master/coverity/covstrap-linux.sh) && eval "$src" || exit 1
env:
COVERITY_SCAN_TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }}
COVERITY_SCAN_EMAIL: ${{ secrets.COVERITY_SCAN_EMAIL }}
COVERITY_BUILD_COMMAND: cmake --build .
build_analyze_linux_pvs_studio_and_codeql:
if: github.repository_owner == 'LongSoft' && github.event_name != 'pull_request'
name: PVS-Studio and CodeQL Static Analysis (shared Qt 6.5.0)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
version: '6.5.0'
host: 'linux'
target: 'desktop'
- name: Install PVS-Studio
run: |
wget -q -O - https://files.pvs-studio.com/etc/pubkey.txt \
| sudo apt-key add -
sudo wget -O /etc/apt/sources.list.d/viva64.list \
https://files.pvs-studio.com/etc/viva64.list
sudo apt update
sudo apt install pvs-studio
pvs-studio-analyzer credentials ${{ secrets.PVS_STUDIO_CREDENTIALS }}
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: cpp
- name: Build everything
run: |
cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=On -B build .
cmake --build build
- name: Perform CodeQL analysis
uses: github/codeql-action/analyze@v2
- name: Perform PVS-Studio analysis
run: |
pvs-studio-analyzer analyze -f build/compile_commands.json -j
- name: Convert PVS-Studio report
run: |
plog-converter -t sarif -o pvs-report.sarif PVS-Studio.log
- name: Publish PVS-Studio report
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: pvs-report.sarif
category: PVS-Studio
build_analyze_linux_sonarcloud:
if: github.repository_owner == 'LongSoft' && github.event_name != 'pull_request'
name: SonarCloud Static Analysis (shared Qt 6.5.0)
runs-on: ubuntu-latest
env:
BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory # Directory where build-wrapper output will be placed
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
version: '6.5.0'
host: 'linux'
target: 'desktop'
- name: Install JDK 17
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 17
- name: Install sonar-scanner and build-wrapper
uses: SonarSource/sonarcloud-github-c-cpp@v2
- name: Run build-wrapper
run: |
cmake -B build .
build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} cmake --build build
- name: Run sonar-scanner
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
sonar-scanner --define sonar.cfamily.build-wrapper-output="${{ env.BUILD_WRAPPER_OUT_DIR }}"