diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 6926785c3..4c4028343 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -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: @@ -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: @@ -117,15 +117,15 @@ 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: | @@ -133,7 +133,7 @@ jobs: # 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: @@ -141,7 +141,7 @@ jobs: 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: @@ -149,15 +149,21 @@ jobs: ~/.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: | @@ -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"