-
Notifications
You must be signed in to change notification settings - Fork 34
92 lines (80 loc) · 3.02 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
name: Rust
on:
push:
branches: ["master"]
pull_request:
branches: ["master"]
env:
CARGO_TERM_COLOR: always
WGPU_DX12_COMPILER: dxc
RUSTFLAGS: --cfg=web_sys_unstable_apis
RUST_BACKTRACE: 1
jobs:
build:
name: Check (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- name: Windows x86_64
os: windows-2022
#TODO: android?
steps:
- uses: actions/checkout@v4
- name: Install rust toolchain
uses: dtolnay/[email protected]
- name: Install cargo-nextest
uses: taiki-e/install-action@v2
with:
tool: cargo-nextest
- name: (linux) install lavapipe, vulkan sdk, alsa
if: matrix.os == 'ubuntu-latest'
shell: bash
run: |
set -e
sudo apt-get update -y -qq
wget -qO - https://packages.lunarg.com/lunarg-signing-key-pub.asc | sudo apt-key add -
sudo wget -qO /etc/apt/sources.list.d/lunarg-vulkan-jammy.list https://packages.lunarg.com/vulkan/lunarg-vulkan-jammy.list
sudo add-apt-repository ppa:kisak/kisak-mesa
sudo apt-get update
sudo apt install -y libegl1-mesa libgl1-mesa-dri libxcb-xfixes0-dev vulkan-sdk mesa-vulkan-drivers pkg-config libasound2-dev
- name: (windows) install dxc
if: matrix.os == 'windows-2022'
uses: napokue/[email protected]
- name: (windows) install warp
if: matrix.os == 'windows-2022'
shell: bash
run: |
set -e
curl.exe -L https://www.nuget.org/api/v2/package/Microsoft.Direct3D.WARP/1.0.7.1 -o warp.zip
7z.exe e warp.zip -owarp build/native/amd64/d3d10warp.dll
mkdir -p target/ratchet/debug/deps
cp -v warp/d3d10warp.dll target/ratchet/debug/
cp -v warp/d3d10warp.dll target/ratchet/debug/deps
- name: (windows) install mesa
if: matrix.os == 'windows-2022'
shell: bash
run: |
set -e
curl.exe -L https://github.com/pal1000/mesa-dist-win/releases/download/23.2.1/mesa3d-23.2.1-release-msvc.7z -o mesa.7z
7z.exe e mesa.7z -omesa x64/{opengl32.dll,libgallium_wgl.dll,libglapi.dll,vulkan_lvp.dll,lvp_icd.x86_64.json}
cp -v mesa/* target/ratchet/debug/
cp -v mesa/* target/ratchet/debug/deps
echo "VK_DRIVER_FILES=$PWD/mesa/lvp_icd.x86_64.json" >> "$GITHUB_ENV"
echo "GALLIUM_DRIVER=llvmpipe" >> "$GITHUB_ENV"
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: '3.10.6'
cache: 'pip'
- run: pip install -r requirements.txt
- name: run tests
shell: bash
run: |
set -e
cargo nextest run -j 1 --features pyo3 --no-fail-fast
# - name: Install wasm-pack
# run: |
# curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
# - name: Run integration tests
# run: (cd crates/ratchet-integration-tests;sh run-tests.sh)