Skip to content

Commit 8baa104

Browse files
committed
Add rust deps to CI
1 parent aafedb0 commit 8baa104

File tree

1 file changed

+53
-2
lines changed

1 file changed

+53
-2
lines changed

.github/workflows/rust.yml

Lines changed: 53 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,68 @@ env:
1313

1414
jobs:
1515
test:
16-
name: Test Rust Shaders
16+
name: Test Rust Shaders - ${{ matrix.name }}
1717
runs-on: ${{ matrix.os }}
1818
strategy:
1919
matrix:
20-
os: [ubuntu-latest, windows-latest, macos-latest]
20+
include:
21+
- os: ubuntu-latest
22+
name: Ubuntu
23+
- os: windows-latest
24+
name: Windows
25+
- os: macos-latest
26+
name: macOS-MoltenVK
27+
use_moltenvk: true
28+
- os: macos-latest
29+
name: macOS-SwiftShader
30+
use_swiftshader: true
2131

2232
steps:
2333
- uses: actions/checkout@v4
2434
with:
2535
submodules: "recursive"
2636

37+
- name: Install Vulkan SDK
38+
uses: jakoch/install-vulkan-sdk-action@v1.0.0
39+
with:
40+
vulkan_version: 1.3.268.0
41+
optional_components: com.lunarg.vulkan.debug
42+
install_runtime: true
43+
cache: true
44+
stripdown: true
45+
46+
- if: ${{ runner.os == 'Linux' }}
47+
name: Install xvfb, llvmpipe and lavapipe
48+
run: |
49+
sudo apt-get update -y -qq
50+
sudo add-apt-repository ppa:kisak/turtle -y
51+
sudo apt-get update
52+
sudo apt install -y xvfb libgl1-mesa-dri libxcb-xfixes0-dev mesa-vulkan-drivers
53+
54+
- if: ${{ matrix.use_moltenvk == true }}
55+
name: Setup MoltenVK on macOS
56+
run: |
57+
# MoltenVK should be installed with the Vulkan SDK
58+
# Find and set the ICD path
59+
VULKAN_SDK_VERSION=$(ls -1 $HOME/VulkanSDK | head -n 1)
60+
echo "VK_ICD_FILENAMES=$HOME/VulkanSDK/$VULKAN_SDK_VERSION/macOS/share/vulkan/icd.d/MoltenVK_icd.json" >> $GITHUB_ENV
61+
62+
- if: ${{ matrix.use_swiftshader == true }}
63+
name: Install SwiftShader on macOS
64+
run: |
65+
# Based on https://github.com/GDRETools/gdsdecomp/blob/master/.github/actions/install-swiftshader/action.yml
66+
git clone https://github.com/google/swiftshader.git
67+
cd swiftshader
68+
mkdir build && cd build
69+
cmake -DSWIFTSHADER_BUILD_TESTS=OFF -DSWIFTSHADER_BUILD_SAMPLES=OFF ..
70+
cmake --build . --config Release
71+
sudo mkdir -p /usr/local/share/vulkan/icd.d
72+
sudo cp Darwin/vk_swiftshader_icd.json /usr/local/share/vulkan/icd.d/
73+
sudo mkdir -p /usr/local/lib
74+
sudo cp Darwin/libvk_swiftshader.dylib /usr/local/lib/
75+
# Set environment variable for SwiftShader ICD
76+
echo "VK_ICD_FILENAMES=/usr/local/share/vulkan/icd.d/vk_swiftshader_icd.json" >> $GITHUB_ENV
77+
2778
- name: Install Rust
2879
uses: dtolnay/rust-toolchain@stable
2980
with:

0 commit comments

Comments
 (0)