Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 20 additions & 14 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ jobs:
- os: macos-latest
name: macOS-SwiftShader
use_swiftshader: true

steps:
- uses: actions/checkout@v4
with:
submodules: "recursive"

- name: Install Vulkan SDK
shell: bash
env:
Expand Down Expand Up @@ -64,19 +64,19 @@ jobs:
echo "PATH=$VULKAN_SDK\\Bin;$PATH" >> $GITHUB_ENV
cd "$GITHUB_WORKSPACE"
fi

- if: ${{ runner.os == 'Linux' }}
name: Install Linux graphics dependencies
run: |
sudo add-apt-repository ppa:kisak/turtle -y
sudo apt-get update
sudo apt install -y xvfb libgl1-mesa-dri libxcb-xfixes0-dev mesa-vulkan-drivers

- if: ${{ runner.os == 'macOS' && matrix.use_moltenvk == true }}
name: Setup MoltenVK on macOS
run: |
echo "VK_ICD_FILENAMES=$HOME/vulkan-sdk/vulkansdk-macos-1.3.250.1/macOS/share/vulkan/icd.d/MoltenVK_icd.json" >> $GITHUB_ENV

- name: Install SwiftShader
if: ${{ matrix.use_swiftshader == true || runner.os == 'Linux' || runner.os == 'Windows' }}
env:
Expand Down Expand Up @@ -117,47 +117,53 @@ jobs:
rm -rf temp-ss-dl/
echo "VK_ICD_FILENAMES=$SWIFTSHADER_DEST_DIR\vk_swiftshader_icd.json" >> $GITHUB_ENV
fi

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
python-version: "3.x"

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable

- name: Install nightly toolchain for cargo-gpu
shell: bash
run: |
# cargo-gpu will auto-install its required toolchain version
# but we need a base nightly toolchain
rustup toolchain install nightly
rustup component add rust-src rustc-dev llvm-tools --toolchain nightly

- name: Install cargo-gpu
shell: bash
env:
RUST_LOG: debug
run: |
# Install cargo-gpu with locked dependencies
cargo install --git https://github.com/rust-gpu/cargo-gpu cargo-gpu --locked

- name: Cache cargo registry
uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}

- name: Set Windows PATH
if: runner.os == 'Windows'
run: echo "$env:USERPROFILE\.cargo\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append

- name: Check Rust shader formatting
working-directory: shaders/rust
run: |
rustup component add rustfmt
cargo fmt --all --check

- name: Compile shaders to SPIR-V
working-directory: shaders/rust
run: python3 compileshaders.py

- name: Verify no uncommitted changes
shell: bash
run: |
Expand All @@ -168,7 +174,7 @@ jobs:
git diff --name-only
exit 1
fi

# Check for untracked files
if [ -n "$(git ls-files --others --exclude-standard)" ]; then
echo "Error: New untracked files were generated"
Expand Down
Loading