forked from alvr-org/ALVR
-
Notifications
You must be signed in to change notification settings - Fork 27
300 lines (265 loc) · 10.1 KB
/
rust.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
name: Rust
on:
push:
branches: [master, alxr-workflows, alxr-uwp-workflows, facial-eye-tracking]
pull_request:
branches: [master, alxr-workflows, alxr-uwp-workflows, facial-eye-tracking]
env:
CARGO_TERM_COLOR: always
jobs:
build_windows:
runs-on: windows-2019
env:
LIBCLANG_PATH: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\Llvm\x64\bin'
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- uses: Swatinem/rust-cache@v1
- name: Build crates
uses: actions-rs/cargo@v1
with:
command: build
args: -p alvr_xtask -p alvr_server -p alvr_launcher --verbose
build_linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- uses: Swatinem/rust-cache@v1
- name: Build and install dependencies
env:
RUST_BACKTRACE: 1
run: |
sudo apt update
sudo apt install build-essential pkg-config nasm libva-dev libdrm-dev libvulkan-dev libx264-dev libx265-dev cmake libasound2-dev libjack-jackd2-dev libgtk-3-dev libunwind-dev libffmpeg-nvenc-dev nvidia-cuda-toolkit
cp packaging/deb/cuda.pc /usr/share/pkgconfig
cargo xtask build-ffmpeg-linux
cd deps/linux/FFmpeg-release-5.1 && sudo make install && cd ../../..
- name: Build crates
uses: actions-rs/cargo@v1
with:
command: build
args: -p alvr_xtask -p alvr_launcher -p alvr_server -p alvr_vulkan-layer -p vrcompositor-wrapper --verbose
build_alxr_win_x64:
runs-on: windows-2022
env:
RUST_BACKTRACE: 1
NINJA_HOME: 'C:/Program Files/Microsoft Visual Studio/2022/Enterprise/Common7/IDE/CommonExtensions/Microsoft/CMake/Ninja'
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- run: rustup update
- uses: Swatinem/rust-cache@v2
with:
cache-targets: "false"
- uses: humbletim/[email protected]
with:
vulkan-query-version: latest
vulkan-components: Vulkan-Headers, Vulkan-Loader, SPIRV-Tools, Glslang
vulkan-use-cache: true
- uses: Jimver/[email protected]
id: cuda-toolkit
with:
method: 'network'
cuda: '12.4.1'
# sub-packages: '["nvcc", "visual_studio_integration"]'
- name: Install Depends & Build
run: |
"C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
$env:Path="$env:NINJA_HOME;$env:Path"
# Fetch alxr-engine submodule.
git submodule update --init --recursive
cargo build -p alxr-client --verbose --features cuda-interop
build_alxr_uwp_arm64:
runs-on: windows-2022
env:
RUST_BACKTRACE: 1
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- run: rustup update
- uses: Swatinem/rust-cache@v2
with:
cache-targets: "false"
- name: Install ALXR Tools/Dependencies
run: |
# Fetch alxr-engine submodule.
git submodule update --init --recursive
Start-Process -FilePath .\alvr\openxr-client\alxr-client\uwp\install_uwp_toolchain.bat -Wait -NoNewWindow
rustup toolchain install nightly-2024-07-19
rustup component add rust-src --toolchain nightly-2024-07-19-x86_64-pc-windows-msvc
rustup update
- name: Build Debug UWP aarch64/arm64
run: |
cargo +nightly-2024-07-19 build -Z build-std=std,panic_abort -p alxr-client-uwp --target aarch64-uwp-windows-msvc --verbose
build_alxr_linux:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- run: rustup update
- uses: Swatinem/rust-cache@v2
with:
cache-targets: "false"
- name: Build and install dependencies
env:
RUST_BACKTRACE: 1
run: |
sudo apt update && sudo apt upgrade -y
# ALVR/FFMPEG specific depends.
sudo apt install build-essential pkg-config nasm libva-dev libdrm-dev libvulkan-dev libx264-dev libx265-dev cmake libasound2-dev libjack-jackd2-dev libgtk-3-dev libunwind-dev libffmpeg-nvenc-dev nvidia-cuda-toolkit
# ALXR specific depends.
sudo apt install git ninja-build libxxf86vm-dev libxcb-glx0-dev libcjson-dev glslang-dev glslang-tools -y
cp packaging/deb/cuda.pc /usr/share/pkgconfig
cargo xtask build-ffmpeg-linux
cd deps/linux/FFmpeg-release-5.1 && sudo make install && cd ../../..
# Fetch alxr-engine submodule.
git submodule update --init --recursive
- name: Build crates
uses: actions-rs/cargo@v1
with:
command: build
args: -p alxr-client --verbose --features cuda-interop
build_alxr_linux_portable:
# ubuntu-20.04
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- run: rustup update
- uses: Swatinem/rust-cache@v2
with:
cache-targets: "false"
- name: Build and install dependencies
env:
RUST_BACKTRACE: 1
run: |
sudo apt update # && sudo apt upgrade -y
# ALVR/FFMPEG specific depends.
sudo apt install build-essential pkg-config nasm libva-dev libdrm-dev libvulkan-dev libx264-dev libx265-dev cmake libasound2-dev libjack-jackd2-dev libgtk-3-dev libunwind-dev
# ALXR specific depends.
sudo apt install git wget gcc-10 g++-10 ninja-build libxxf86vm-dev libxcb-glx0-dev libcjson-dev glslang-dev glslang-tools -y
# ubuntu-focal cmake package is too old...
CMAKE_FILE=cmake-3.27.7-linux-x86_64.sh
wget https://github.com/Kitware/CMake/releases/download/v3.27.7/${CMAKE_FILE}
chmod +x ${CMAKE_FILE}
./${CMAKE_FILE} --skip-license --include-subdir
export PATH=${PWD}/cmake-3.27.7-linux-x86_64:$PATH
# ubuntu-focal glslang package is too old...
wget https://github.com/KhronosGroup/glslang/releases/download/master-tot/glslang-master-linux-Release.zip
unzip glslang-master-linux-Release.zip -d glslang
export PATH=${PWD}/glslang/bin:$PATH
export CC=/usr/bin/gcc-10
export CXX=/usr/bin/g++-10
# Fetch alxr-engine submodule.
git submodule update --init --recursive
echo "$PATH" >> $GITHUB_PATH
- name: Build crates
env:
CC: /usr/bin/gcc-10
CXX: /usr/bin/g++-10
RUST_BACKTRACE: 1
run: |
cargo xtask build-alxr-client --release --bundle-ffmpeg --gpl --no-nvidia --ffmpeg-version=release/4.4
build_alxr_android:
runs-on: ubuntu-22.04
env:
ANDROID_NDK_ROOT: /usr/local/lib/android/sdk/ndk/27.1.12297006
ANDROID_NDK_HOME: /usr/local/lib/android/sdk/ndk/27.1.12297006
ANDROID_CMAKE_BIN: /usr/local/lib/android/sdk/cmake/3.30.3/bin
RUST_BACKTRACE: 1
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- run: rustup update
- uses: Swatinem/rust-cache@v2
with:
cache-targets: "false"
- name: Prepare android deps
run: |
sudo apt update && sudo apt upgrade -y
sudo apt install gcc-multilib
SDK_MANAGER=$ANDROID_SDK_ROOT/cmdline-tools/latest/bin/sdkmanager
yes | sudo $SDK_MANAGER --install "ndk;27.1.12297006" "platforms;android-29" "cmake;3.30.3"
rustup target add aarch64-linux-android armv7-linux-androideabi x86_64-linux-android i686-linux-android
cargo install cargo-apk --git https://github.com/korejan/cargo-apk.git --branch android-manifest-entries
# Fetch alxr-engine submodule.
git submodule update --init --recursive
- name: Build alxr-android-generic
run: |
unset ANDROID_HOME
JAVA_HOME=$JAVA_HOME_17_X64
export PATH=$ANDROID_CMAKE_BIN:$PATH
cargo apk build -p alxr-client-android
- name: Build alxr-android-pico
run: |
unset ANDROID_HOME
JAVA_HOME=$JAVA_HOME_17_X64
export PATH=$ANDROID_CMAKE_BIN:$PATH
cargo apk build -p alxr-client-pico --target-dir=target/pico
tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- uses: Swatinem/rust-cache@v1
- name: Run tests
uses: actions-rs/cargo@v1
with:
command: test
args: -p alvr_session --verbose
rustfmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt
- uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
clippy:
runs-on: windows-2019
env:
LIBCLANG_PATH: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\Llvm\x64\bin'
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: clippy
- uses: Swatinem/rust-cache@v1
- uses: ErichDonGubler/clippy-check@fix-windows-lf-breaking-reports
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: -p alvr_xtask -p alvr_common -p alvr_server -p alvr_launcher