-
Notifications
You must be signed in to change notification settings - Fork 53
320 lines (268 loc) · 8.47 KB
/
Copy pathtests.yml
File metadata and controls
320 lines (268 loc) · 8.47 KB
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
name: tests
on:
push:
branches:
- develop
pull_request:
branches:
- develop
- main
workflow_call:
workflow_dispatch:
jobs:
tests-windows:
runs-on: windows-2022
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Download and extract vcpkg cache and unpackers
run: |
$ProgressPreference = "SilentlyContinue"
Invoke-WebRequest https://github.com/nzbgetcom/build-files/releases/download/v5.0/vcpkg-windows-x64.zip -OutFile "${{ github.workspace }}\vcpkg.zip"
Expand-Archive -Path "${{ github.workspace }}\vcpkg.zip" -DestinationPath "${{ github.workspace }}"
Invoke-WebRequest https://github.com/nzbgetcom/build-files/releases/download/v10.0/nzbget-windows-tools.zip -OutFile "${{ github.workspace }}\tools.zip"
Expand-Archive -Path "${{ github.workspace }}\tools.zip" -DestinationPath C:\
Copy-Item "C:\nzbget\image\64\unrar.exe" -Destination "C:\Windows\System32"
Copy-Item "C:\nzbget\image\64\7za.exe" -Destination "C:\Windows\System32\7z.exe"
- name: Build
run: |
New-Item build -ItemType Directory -Force | Out-Null
cd build
cmake .. -DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}\vcpkg\scripts\buildsystems\vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows-static -DBUILD_ONLY_TESTS=ON
cmake --build . --config Release -j 4
- name: Test
run: |
cd build
ctest -C Release
- name: Upload test artifacts
uses: actions/upload-artifact@v7
if: failure()
with:
name: nzbget-windows-test-log
path: build/Testing/Temporary/LastTest.log
retention-days: 5
tests-linux:
runs-on: ubuntu-24.04
steps:
- name: Prepare environment
run: |
sudo apt-get update
sudo apt-get install -y cmake libxml2-dev libssl-dev libncurses-dev libboost-all-dev python3-cryptography unrar 7zip
- name: Checkout
uses: actions/checkout@v6
- name: Build
run: |
mkdir build
cd build
cmake .. -DBUILD_ONLY_TESTS=ON
cmake --build . --config Release -j 4
- name: Test
run: |
cd build
ctest -C Release
- name: Upload test artifacts
uses: actions/upload-artifact@v7
if: failure()
with:
name: nzbget-linux-test-log
path: build/Testing/Temporary/LastTest.log
retention-days: 5
tests-linux-disabled-parcheck:
runs-on: ubuntu-24.04
steps:
- name: Prepare environment
run: |
sudo apt-get update
sudo apt-get install -y cmake libxml2-dev libssl-dev libncurses-dev libboost-all-dev python3-cryptography unrar 7zip
- name: Checkout
uses: actions/checkout@v6
- name: Build
run: |
mkdir build
cd build
cmake .. -DBUILD_ONLY_TESTS=ON -DDISABLE_PARCHECK=yes
cmake --build . --config Release -j 4
- name: Test
run: |
cd build
ctest -C Release
- name: Upload test artifacts
uses: actions/upload-artifact@v7
if: failure()
with:
name: nzbget-linux-test-log
path: build/Testing/Temporary/LastTest.log
retention-days: 5
tests-macos:
runs-on: macos-latest
steps:
- name: Install dependencies
run: |
brew install --formula boost sevenzip
brew install --cask rar
- name: Checkout
uses: actions/checkout@v6
- name: Build
run: |
mkdir build
cd build
cmake .. -DBUILD_ONLY_TESTS=ON
cmake --build . --config Release -j 4
- name: Test
run: |
cd build
ctest -C Release
- name: Upload test artifacts
uses: actions/upload-artifact@v7
if: failure()
with:
name: nzbget-linux-test-log
path: build/Testing/Temporary/LastTest.log
retention-days: 5
tests-openbsd:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v6
- name: OpenBSD build and test
uses: cross-platform-actions/action@v0.28.0
with:
operating_system: openbsd
version: '7.7'
run: |
sudo pkg_add git cmake libxml boost unrar p7zip
mkdir build
cd build
cmake .. -DBUILD_ONLY_TESTS=ON -DCURSES_INCLUDE_PATH=/usr/include
cmake --build . --config Release -j 4
ctest -C Release --repeat until-pass:5
- name: Upload test artifacts
uses: actions/upload-artifact@v7
if: failure()
with:
name: nzbget-openbsd-test-log
path: build/Testing/Temporary/LastTest.log
retention-days: 5
tests-freebsd:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v6
- name: FreeBSD build and test
uses: cross-platform-actions/action@v0.27.0
with:
operating_system: freebsd
version: '14.2'
run: |
sudo pkg install -y git cmake libxml2 boost-all unrar 7-zip
mkdir build
cd build
cmake .. -DBUILD_ONLY_TESTS=ON -DCURSES_INCLUDE_PATH=/usr/include
cmake --build . --config Release -j 4
ctest -C Release
- name: Upload test artifacts
uses: actions/upload-artifact@v7
if: failure()
with:
name: nzbget-freebsd-test-log
path: build/Testing/Temporary/LastTest.log
retention-days: 5
cppcheck:
runs-on: ubuntu-24.04
continue-on-error: true
steps:
- name: Prepare environment
run: |
sudo apt-get update
sudo apt-get install -y cmake libxml2-dev libssl-dev libncurses-dev libboost-all-dev cppcheck
- name: Checkout
uses: actions/checkout@v6
- name: cppcheck
run: |
mkdir build && cd build
cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON ..
cppcheck --error-exitcode=1 \
--project=compile_commands.json \
--enable=all \
--inline-suppr \
--check-level=exhaustive \
--suppress=missingIncludeSystem \
--suppress=unknownMacro:tests/ \
--suppress=preprocessorErrorDirective:build/par2-turbo/ \
-itests \
-ibuild/rapidyenc \
-ibuild/boost \
-ibuild/par2-turbo
build-disabled-parcheck:
runs-on: ubuntu-24.04
steps:
- name: Prepare environment
run: |
sudo apt-get update
sudo apt-get install -y cmake libxml2-dev libssl-dev libncurses-dev libboost-all-dev
- name: Checkout
uses: actions/checkout@v6
- name: Build
run: |
mkdir build
cd build
cmake .. -DDISABLE_PARCHECK=yes
cmake --build . --config Release -j 4
build-disabled-pch:
runs-on: ubuntu-24.04
steps:
- name: Prepare environment
run: |
sudo apt-get update
sudo apt-get install -y cmake libxml2-dev libssl-dev libncurses-dev libboost-all-dev
- name: Checkout
uses: actions/checkout@v6
- name: Build
run: |
mkdir build
cd build
cmake .. -DCMAKE_DISABLE_PRECOMPILE_HEADERS=yes
cmake --build . --config Release -j 4
build-openbsd:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v6
- name: OpenBSD build
uses: cross-platform-actions/action@v0.28.0
with:
operating_system: openbsd
version: '7.7'
run: |
sudo pkg_add git cmake libxml boost
mkdir build
cd build
cmake .. -DCURSES_INCLUDE_PATH=/usr/include
cmake --build . --config Release -j 4
build-macos-brew-head:
runs-on: macos-latest
if: github.ref_name == 'develop'
steps:
- name: Build
run: |
brew install --formula boost sevenzip
brew install nzbget --formula --head --verbose
functional-dupefallback-smoke:
runs-on: ubuntu-24.04
steps:
- name: Prepare environment
run: |
sudo apt-get update
sudo apt-get install -y cmake libxml2-dev libssl-dev libncurses-dev libboost-all-dev python3-cryptography unrar 7zip
- name: Checkout
uses: actions/checkout@v6
- name: Build daemon
run: |
cmake -S . -B build-functional -DCMAKE_BUILD_TYPE=Release
cmake --build build-functional -j 4
- name: Run representative fallback scenarios
run: |
for scenario in complementary leadswitch stream repost xdecomp_zip xdecomp_symlink; do
python3 tests/functional/dupefallback/harness.py \
--nzbget build-functional/nzbget --target local --scenario "$scenario"
done