-
-
Notifications
You must be signed in to change notification settings - Fork 168
278 lines (235 loc) · 10.5 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
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
name: D++ CI
on:
push:
paths:
- '**Dockerfile'
- '**.cxx'
- '**.cpp'
- '**.h'
- '**.hpp'
- '**.cmake'
- '**ci.yml'
- '**CMakeLists.txt'
pull_request:
paths:
- '**Dockerfile'
- '**.cxx'
- '**.cpp'
- '**.h'
- '**.hpp'
- '**.cmake'
- '**ci.yml'
- '**CMakeLists.txt'
jobs:
linux-with-unit-test:
concurrency:
group: linux-build-unit-test
cancel-in-progress: false
name: Linux ${{matrix.cfg.arch}} (${{matrix.cfg.cpp-version}})
runs-on: ${{matrix.cfg.os}}
strategy:
fail-fast: false # Don't fail everything if one fails. We want to test each OS/Compiler individually
matrix:
cfg:
- { arch: 'amd64', os: ubuntu-20.04, cpp-version: g++-8 }
steps:
- name: Harden Runner
uses: step-security/harden-runner@8ca2b8b2ece13480cda6dacd3511b49857a23c09 # v2.5.1
with:
egress-policy: audit
- name: Checkout D++
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
- name: Install apt packages
run: sudo sed -i 's/azure\.//' /etc/apt/sources.list && sudo apt update && sudo apt install ${{ matrix.cfg.cpp-version }} libsodium-dev libopus-dev zlib1g-dev rpm
- name: Generate CMake
run: mkdir build && cd build && cmake -DDPP_NO_VCPKG=ON -DAVX_TYPE=AVX0 -DCMAKE_BUILD_TYPE=Release ..
env:
CXX: ${{matrix.cfg.cpp-version}}
- name: Build Project
run: cd build && make -j2
- name: Run unit tests
run: cd build/library && ./unittest
env:
DPP_UNIT_TEST_TOKEN: ${{secrets.DPP_UNIT_TEST_TOKEN}}
TEST_GUILD_ID: ${{secrets.TEST_GUILD_ID}}
TEST_TEXT_CHANNEL_ID: ${{secrets.TEST_TEXT_CHANNEL_ID}}
TEST_VC_ID: ${{secrets.TEST_VC_ID}}
TEST_USER_ID: ${{secrets.TEST_USER_ID}}
TEST_EVENT_ID: ${{secrets.TEST_EVENT_ID}}
linux-no-unit-tests:
name: Linux ${{matrix.cfg.arch}} (${{matrix.cfg.cpp-version}})
runs-on: ${{matrix.cfg.os}}
strategy:
fail-fast: false # Don't fail everything if one fails. We want to test each OS/Compiler individually
matrix:
cfg:
- { arch: 'amd64', os: ubuntu-22.04, cpp-version: g++-12, cmake-flags: '-DDPP_CORO=ON' }
- { arch: 'amd64', os: ubuntu-22.04, cpp-version: g++-11, cmake-flags: '-DDPP_CORO=ON' }
- { arch: 'amd64', os: ubuntu-22.04, cpp-version: g++-10, cmake-flags: '' }
- { arch: 'amd64', os: ubuntu-20.04, cpp-version: g++-9, cmake-flags: '' }
steps:
- name: Harden Runner
uses: step-security/harden-runner@8ca2b8b2ece13480cda6dacd3511b49857a23c09 # v2.5.1
with:
egress-policy: audit
- name: Checkout D++
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
- name: Install apt packages
run: sudo sed -i 's/azure\.//' /etc/apt/sources.list && sudo apt update && sudo apt install ${{ matrix.cfg.cpp-version }} libsodium-dev libopus-dev zlib1g-dev rpm
- name: Generate CMake
run: mkdir build && cd build && cmake -DDPP_NO_VCPKG=ON -DAVX_TYPE=AVX0 -DCMAKE_BUILD_TYPE=Release ${{matrix.cfg.cmake-flags}} ..
env:
CXX: ${{matrix.cfg.cpp-version}}
- name: Build Project
run: cd build && make -j2
- name: Package distributable
if: ${{ matrix.cfg.cpp-version == 'g++-10' }}
run: cd build && cpack --verbose
- name: Upload Binary (DEB)
if: ${{ matrix.cfg.cpp-version == 'g++-10' }}
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
with:
name: "libdpp - Debian Package ${{matrix.cfg.arch}}"
path: '${{github.workspace}}/build/*.deb'
- name: Upload Binary (RPM)
if: ${{ matrix.cfg.cpp-version == 'g++-10' }}
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
with:
name: "libdpp - RPM Package ${{matrix.cfg.arch}}"
path: '${{github.workspace}}/build/*.rpm'
macos:
name: macOS x64
runs-on: macos-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@8ca2b8b2ece13480cda6dacd3511b49857a23c09 # v2.5.1
with:
egress-policy: audit
- name: Checkout D++
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
- name: Install homebrew packages
run: brew install cmake make libsodium opus openssl
- name: Generate CMake
run: mkdir build && cd build && cmake -DDPP_NO_VCPKG=ON -DCMAKE_BUILD_TYPE=Release -DDPP_CORO=ON -DAVX_TYPE=AVX0 ..
env:
DONT_RUN_VCPKG: true
- name: Build Project
run: cd build && make -j2
env:
DONT_RUN_VCPKG: true
windows: # Windows x64 and x86 build matrix
strategy:
fail-fast: false # Don't cancel other matrix jobs if one fails
matrix:
cfg:
- { name: x64, arch: x64, config: Release, vs: '2019', os: 'windows-2019', vsv: '16' }
- { name: x64, arch: x64, config: Debug, vs: '2019', os: 'windows-2019', vsv: '16' }
- { name: x86, arch: x86, config: Release, vs: '2019', os: 'windows-2019', vsv: '16' }
- { name: x86, arch: x86, config: Debug, vs: '2019', os: 'windows-2019', vsv: '16' }
- { name: x64, arch: x64, config: Release, vs: '2022', os: 'windows-2022', vsv: '17' }
- { name: x64, arch: x64, config: Debug, vs: '2022', os: 'windows-2022', vsv: '17' }
- { name: x86, arch: x86, config: Release, vs: '2022', os: 'windows-2022', vsv: '17' }
- { name: x86, arch: x86, config: Debug, vs: '2022', os: 'windows-2022', vsv: '17' }
name: "Windows ${{matrix.cfg.name}}-${{matrix.cfg.config}}-vs${{matrix.cfg.vs}}"
runs-on: ${{matrix.cfg.os}}
steps:
- name: Harden Runner
uses: step-security/harden-runner@8ca2b8b2ece13480cda6dacd3511b49857a23c09 # v2.5.1
with:
egress-policy: audit
- name: Checkout D++
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
with:
path: main
- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@1ff57057b5cfdc39105cd07a01d78e9b0ea0c14c # v1.3.1
- name: Install chocolatey packages ${{ matrix.cfg.arch}}
uses: seanmiddleditch/gha-setup-ninja@6263846cf3c17009dfc81604efabae16044fc074 # master
- name: Generate CMake (x64)
if: ${{ matrix.cfg.arch == 'x64' }}
run: mkdir main/build && cd main/build && cmake -G "Visual Studio ${{matrix.cfg.vsv}} ${{matrix.cfg.vs}}" -DDPP_NO_VCPKG=ON -DAVX_TYPE=AVX0 ..
env:
DONT_RUN_VCPKG: true
- name: Generate CMake (x86)
if: ${{ matrix.cfg.arch == 'x86' }}
run: mkdir main/build && cd main/build && cmake -DCMAKE_TOOLCHAIN_FILE="cmake\Win32Toolchain.cmake" -DDPP_NO_VCPKG=ON -DAVX_TYPE=AVX0 -G "Visual Studio ${{matrix.cfg.vsv}} ${{matrix.cfg.vs}}" -A Win32 -T host=x86 ..
env:
DONT_RUN_VCPKG: true
- name: Build Project
run: cmake --build main/build --target dpp --config ${{matrix.cfg.config}} --parallel 2
env:
DONT_RUN_VCPKG: true
- name: Move debug files for packaging
if: ${{ matrix.cfg.config == 'Debug' }}
run: xcopy main\build\library\Debug\* main\build\library\Release\ /s /q
- name: Package distributable
run: cd main/build && cpack --verbose
env:
DONT_RUN_VCPKG: true
- name: Upload Binary
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
with:
name: "libdpp - Windows ${{matrix.cfg.name}}-${{matrix.cfg.config}}-vs${{matrix.cfg.vs}}"
path: '${{github.workspace}}/main/build/*.zip'
cross-compiles:
strategy:
fail-fast: false
matrix:
cfg:
- {name: "ARM64", os: ubuntu-20.04, cmake-options: -DCMAKE_TOOLCHAIN_FILE=cmake/ARM64ToolChain.cmake}
- {name: "ARMv7 HF", os: ubuntu-20.04, cmake-options: -DCMAKE_TOOLCHAIN_FILE=cmake/ARMv7ToolChain.cmake}
- {name: "Linux x86", os: ubuntu-20.04, cmake-options: -DCMAKE_TOOLCHAIN_FILE=cmake/LINUXx86ToolChain.cmake -DBUILD_VOICE_SUPPORT=OFF}
- {name: "ARMv6", os: ubuntu-20.04, cmake-options: -DCMAKE_TOOLCHAIN_FILE=cmake/ARMv6ToolChain.cmake}
name: ${{matrix.cfg.name}}
runs-on: ${{matrix.cfg.os}}
steps:
- name: Harden Runner
uses: step-security/harden-runner@8ca2b8b2ece13480cda6dacd3511b49857a23c09 # v2.5.1
with:
egress-policy: audit
- name: Checkout D++
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
- name: Install Packages
run: sudo sed -i 's/azure\.//' /etc/apt/sources.list && sudo apt update && sudo apt install cmake rpm
- name: Generate CMakeFiles
run: mkdir build && cd build && sudo cmake ${{matrix.cfg.cmake-options}} -DDPP_NO_VCPKG=ON -DCMAKE_BUILD_TYPE=Release -DAVX_TYPE=AVX0 ..
- name: Compile Source
run: cd build && sudo make -j2
- name: Package Distributable
run: cd build && sudo cpack --verbose || cat /home/runner/work/DPP/DPP/build/_CPack_Packages/Linux/DEB/PreinstallOutput.log
- name: Upload Binaries (DEB)
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
with:
name: "libdpp - Debian Package ${{matrix.cfg.name}}"
path: "${{github.workspace}}/build/*.deb"
- name: Upload Binaries (RPM)
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
with:
name: "libdpp - RPM Package ${{matrix.cfg.name}}"
path: "${{github.workspace}}/build/*.rpm"
# testfreebsd:
# runs-on: macos-10.15
# name: FreeBSD (g++-10)
# steps:
# - uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
# - name: FreeBSD Build and Package
# id: freebsdtest
# uses: vmactions/[email protected]
# with:
# usesh: true
# prepare: pkg install -y openssl-devel gcc gmake cmake git
# run: |
# pwd
# ls -lah
# mkdir build
# cd build
# cmake -DAVX_TYPE=AVX0 -DDPP_NO_VCPKG=ON -DCMAKE_BUILD_TYPE=Release ..
# make -j2
# make install
# cpack --verbose
#
# - name: Upload Binaries (BZ2)
# uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
# with:
# name: "libdpp - FreeBSD x64"
# path: "${{github.workspace}}/build/*.tar.bz2"