-
Notifications
You must be signed in to change notification settings - Fork 56
263 lines (229 loc) · 9.34 KB
/
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
256
257
258
259
260
261
262
263
name: CI
on: [push, pull_request, workflow_dispatch]
env:
# Path to the solution file relative to the root of the project.
SOLUTION_FILE_PATH: .
# Configuration type to build.
# You can convert this to a build matrix if you need coverage of multiple configuration types.
# https://docs.github.com/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
BUILD_CONFIGURATION: Release
jobs:
build:
name: Build & test on ${{ matrix.os }} with ${{ matrix.compiler }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-12, windows-latest]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Sys info
if: "startsWith(matrix.os, 'windows')"
run: wmic cpu get name, numberofcores, maxclockspeed
- name: Sys info
if: "startsWith(matrix.os, 'mac')"
run: sysctl -a | grep cpu | grep hw
- name: Sys info
if: "startsWith(matrix.os, 'ubuntu')"
run: |
lscpu
- name: Github environment
run: echo '${{ toJSON(github) }}'
- name: Install Qt
if: "startsWith(matrix.os, 'windows')"
uses: jurplel/install-qt-action@v3
with:
version: '6.6.3'
arch: 'win64_msvc2019_64'
archives: 'qtbase icu qtsvg'
modules: 'qt5compat qtimageformats'
- name: Install Qt
if: "startsWith(matrix.os, 'ubuntu')"
uses: jurplel/install-qt-action@v3
with:
version: '6.6.1'
arch: 'gcc_64'
archives: 'qtbase icu qtsvg'
modules: 'qt5compat qtimageformats'
- name: Install Qt
if: "startsWith(matrix.os, 'macos')"
uses: jurplel/install-qt-action@v3
with:
version: '6.6.1'
arch: 'clang_64'
archives: 'qtbase icu qtsvg'
modules: 'qt5compat qtimageformats'
- name: Windows - setup MSBuild
if: startsWith(matrix.os, 'windows')
uses: microsoft/setup-msbuild@v1
- name: Windows - building main installer
if: startsWith(matrix.os, 'windows')
shell: cmd
run: |
%Qt6_DIR%\bin\qmake.exe -v
set QTDIR64=%Qt6_DIR%
cd installer\windows\
create_installer.bat
cd ..\..
xcopy /R /Y .\installer\windows\binaries\64\msvcr\* .\bin\release\x64\
xcopy /R /Y .\installer\windows\binaries\64\Qt\* .\bin\release\x64\
- name: Mac
if: startsWith(matrix.os, 'macos')
working-directory: ${{env.GITHUB_WORKSPACE}}
run: |
clang --version
./installer/mac/create_dmg.sh $Qt6_DIR
- name: Linux
if: startsWith(matrix.os, 'ubuntu')
working-directory: ${{env.GITHUB_WORKSPACE}}
run: |
export QT_DEBUG_PLUGINS=1
sudo apt update -y; sudo apt install -qq gcc-12 g++-12 libglu1-mesa-dev libx11-xcb-dev '^libxcb*' '^libxkb*' libfuse2
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-12 50
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 50
g++ --version
export PATH=$Qt6_DIR/bin/:$PATH
wget -c -nv "https://github.com/probonopd/linuxdeployqt/releases/download/7/linuxdeployqt-7-x86_64.AppImage"
chmod a+x linuxdeployqt-7-x86_64.AppImage
unset QTDIR; unset QT_PLUGIN_PATH ; unset LD_LIBRARY_PATH
$Qt6_DIR/bin/qmake -r CONFIG+=release
make -j
# Linux: building AppImage
cp ./qt-app/resources/icon.png ./bin/release/x64/
cp ./installer/linux/file_commander.desktop ./bin/release/x64/
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${Qt6_DIR}/lib/
sudo ldconfig
./linuxdeployqt-7-x86_64.AppImage ./bin/release/x64/FileCommander -appimage -unsupported-allow-new-glibc -bundle-non-qt-libs -qmake=$Qt6_DIR/bin/qmake -executable=./bin/release/x64/libplugin_filecomparison.so.1.0.0 -executable=./bin/release/x64/libplugin_imageviewer.so.1.0.0 -executable=./bin/release/x64/libplugin_textviewer.so.1.0.0
ls -Ac
mv ./File_Commander*.AppImage ./FileCommander.AppImage
- name: Test launch
if: startsWith(matrix.os, 'macos')
run: ./bin/release/x64/FileCommander.app/Contents/MacOS/FileCommander --test-launch
- name: Test launch
if: startsWith(matrix.os, 'ubuntu')
run: |
xvfb-run --auto-servernum ./bin/release/x64/FileCommander --test-launch
- name: Test launch
if: startsWith(matrix.os, 'widows')
run: |
.\bin\release\x64\FileCommander.exe --test-launch
- name: Building tests - Windows
if: startsWith(matrix.os, 'windows')
working-directory: ${{env.GITHUB_WORKSPACE}}
shell: cmd
run: |
cd file-commander-core\core-tests\
dir
call "%programfiles%\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" amd64 && "%Qt6_DIR%\bin\qmake.exe" -tp vc -r
msbuild /t:Build /p:Configuration=Release;PlatformToolset=v143 core-tests.sln
cd ..\..
- name: Running tests - Windows
if: startsWith(matrix.os, 'windows')
shell: powershell
run: |
.\bin\release\x64\fso_test.exe
.\bin\release\x64\fso_test_high_level.exe
For ($i=1; $i -le 20; $i++) {
$randomSeed = ((get-date -Uformat %s).remove(10, 1));
$randomSeed = $randomSeed.substring($randomSeed.Length - 8);
& .\bin\release\x64\operationperformer_test.exe --std-seed $randomSeed;
}
$randomSeed = ((get-date -Uformat %s).remove(10, 1));
$randomSeed = $randomSeed.substring($randomSeed.Length - 8);
& .\bin\release\x64\filecomparator_test.exe --std-seed $randomSeed;
- name: Building tests - Mac
if: startsWith(matrix.os, 'macos')
run: |
cd file-commander-core/core-tests
$Qt6_DIR/bin/qmake -r CONFIG+=release
make -j
cd ../../
for f in $(find bin/release/x64/ -name *.app); do $Qt6_DIR/bin/macdeployqt $f; done
- name: Running tests - Mac
if: startsWith(matrix.os, 'macos')
run: |
set -e; ./bin/release/x64/fso_test.app/Contents/MacOS/fso_test
set -e; ./bin/release/x64/fso_test_high_level.app/Contents/MacOS/fso_test_high_level
set -e; for i in `seq 1 20`; do ./bin/release/x64/operationperformer_test.app/Contents/MacOS/operationperformer_test --std-seed $(date +%s); sleep 1; done
set -e; ./bin/release/x64/filecomparator_test.app/Contents/MacOS/filecomparator_test --std-seed $(date +%s)
- name: Building tests - Linux
if: startsWith(matrix.os, 'ubuntu')
run: |
cd file-commander-core/core-tests
$Qt6_DIR/bin/qmake -r CONFIG+=release
make -j
cd ../../
for f in $(find bin/release/x64/ -name *.app); do $Qt6_DIR/bin/macdeployqt $f; done
./linuxdeployqt-7-x86_64.AppImage ./bin/release/x64/fso_test -unsupported-allow-new-glibc -bundle-non-qt-libs
./linuxdeployqt-7-x86_64.AppImage ./bin/release/x64/fso_test_high_level -unsupported-allow-new-glibc -bundle-non-qt-libs
./linuxdeployqt-7-x86_64.AppImage ./bin/release/x64/operationperformer_test -unsupported-allow-new-glibc -bundle-non-qt-libs
./linuxdeployqt-7-x86_64.AppImage ./bin/release/x64/filecomparator_test -unsupported-allow-new-glibc -bundle-non-qt-libs
- name: Running tests - Linux
if: startsWith(matrix.os, 'ubuntu')
run: |
set -e; ./bin/release/x64/fso_test
set -e; ./bin/release/x64/fso_test_high_level
set -e; for i in `seq 1 20`; do ./bin/release/x64/operationperformer_test --std-seed $(date +%s); sleep 1; done
set -e; ./bin/release/x64/filecomparator_test --std-seed $(date +%s)
- name: Archive DMG
if: success() && startsWith(matrix.os, 'macos')
uses: actions/upload-artifact@v4
with:
name: FileCommander.dmg
path: FileCommander.dmg
- name: Archive AppImage
if: success() && startsWith(matrix.os, 'ubuntu')
uses: actions/upload-artifact@v4
with:
name: FileCommander.AppImage
path: FileCommander.AppImage
- name: Archive Installer
if: success() && startsWith(matrix.os, 'windows')
uses: actions/upload-artifact@v4
with:
name: FileCommander.exe
path: installer/windows/FileCommander.exe
create-release:
needs: build
if: success() && startsWith(github.ref, 'refs/tags/')
permissions:
contents: write
deployments: write
pull-requests: read
runs-on: ubuntu-latest
steps:
- name: 'Build Changelog'
id: build_changelog
uses: mikepenz/release-changelog-builder-action@v4
with:
token: '${{ github.token }}'
- name: Download EXE
uses: actions/download-artifact@v4
with:
name: FileCommander.exe
path: .
- name: Download DMG
uses: actions/download-artifact@v4
with:
name: FileCommander.dmg
path: .
- name: Download AppImage
uses: actions/download-artifact@v4
with:
name: FileCommander.AppImage
path: .
- name: Create Release
uses: softprops/action-gh-release@v2
if: success() && startsWith(github.ref, 'refs/tags/')
with:
files: |
FileCommander.exe
FileCommander.dmg
FileCommander.AppImage
token: ${{ secrets.GITHUB_TOKEN }}
tag_name: ${{ github.ref }}
name: ${{ github.ref_name }}
body: ${{steps.build_changelog.outputs.changelog}}