-
Notifications
You must be signed in to change notification settings - Fork 19
111 lines (91 loc) · 2.55 KB
/
tests.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
name: tests
on:
push:
branches:
- develop
- main
pull_request:
branches:
- develop
- main
workflow_call:
workflow_dispatch:
jobs:
windows-tests:
runs-on: windows-2022
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download and extract vcpkg cache
run: |
$ProgressPreference = "SilentlyContinue"
Invoke-WebRequest https://github.com/nzbgetcom/build-files/releases/download/v1.0/vcpkg-windows-tests.zip -OutFile "${{ github.workspace }}\vcpkg.zip"
Expand-Archive -Path "${{ github.workspace }}\vcpkg.zip" -DestinationPath "${{ github.workspace }}"
- 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@v4
if: failure()
with:
name: nzbget-windows-test-log
path: build/Testing/Temporary/LastTest.log
retention-days: 5
linux-tests:
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@v4
- 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@v4
if: failure()
with:
name: nzbget-linux-test-log
path: build/Testing/Temporary/LastTest.log
retention-days: 5
macos-tests:
runs-on: macos-14
steps:
- name: Install dependencies
run:
brew install --formula boost
- name: Checkout
uses: actions/checkout@v4
- 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@v4
if: failure()
with:
name: nzbget-linux-test-log
path: build/Testing/Temporary/LastTest.log
retention-days: 5