@@ -26,12 +26,12 @@ jobs:
26
26
- os : macos-latest
27
27
name : macOS-SwiftShader
28
28
use_swiftshader : true
29
-
29
+
30
30
steps :
31
31
- uses : actions/checkout@v4
32
32
with :
33
33
submodules : " recursive"
34
-
34
+
35
35
- name : Install Vulkan SDK
36
36
shell : bash
37
37
env :
@@ -64,19 +64,19 @@ jobs:
64
64
echo "PATH=$VULKAN_SDK\\Bin;$PATH" >> $GITHUB_ENV
65
65
cd "$GITHUB_WORKSPACE"
66
66
fi
67
-
67
+
68
68
- if : ${{ runner.os == 'Linux' }}
69
69
name : Install Linux graphics dependencies
70
70
run : |
71
71
sudo add-apt-repository ppa:kisak/turtle -y
72
72
sudo apt-get update
73
73
sudo apt install -y xvfb libgl1-mesa-dri libxcb-xfixes0-dev mesa-vulkan-drivers
74
-
74
+
75
75
- if : ${{ runner.os == 'macOS' && matrix.use_moltenvk == true }}
76
76
name : Setup MoltenVK on macOS
77
77
run : |
78
78
echo "VK_ICD_FILENAMES=$HOME/vulkan-sdk/vulkansdk-macos-1.3.250.1/macOS/share/vulkan/icd.d/MoltenVK_icd.json" >> $GITHUB_ENV
79
-
79
+
80
80
- name : Install SwiftShader
81
81
if : ${{ matrix.use_swiftshader == true || runner.os == 'Linux' || runner.os == 'Windows' }}
82
82
env :
@@ -117,47 +117,53 @@ jobs:
117
117
rm -rf temp-ss-dl/
118
118
echo "VK_ICD_FILENAMES=$SWIFTSHADER_DEST_DIR\vk_swiftshader_icd.json" >> $GITHUB_ENV
119
119
fi
120
-
120
+
121
121
- name : Setup Python
122
122
uses : actions/setup-python@v5
123
123
with :
124
- python-version : ' 3.x'
125
-
124
+ python-version : " 3.x"
125
+
126
126
- name : Install Rust toolchain
127
127
uses : dtolnay/rust-toolchain@stable
128
-
128
+
129
129
- name : Install nightly toolchain for cargo-gpu
130
130
shell : bash
131
131
run : |
132
132
# cargo-gpu will auto-install its required toolchain version
133
133
# but we need a base nightly toolchain
134
134
rustup toolchain install nightly
135
135
rustup component add rust-src rustc-dev llvm-tools --toolchain nightly
136
-
136
+
137
137
- name : Install cargo-gpu
138
138
shell : bash
139
139
env :
140
140
RUST_LOG : debug
141
141
run : |
142
142
# Install cargo-gpu with locked dependencies
143
143
cargo install --git https://github.com/rust-gpu/cargo-gpu cargo-gpu --locked
144
-
144
+
145
145
- name : Cache cargo registry
146
146
uses : actions/cache@v3
147
147
with :
148
148
path : |
149
149
~/.cargo/registry
150
150
~/.cargo/git
151
151
key : ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
152
-
152
+
153
153
- name : Set Windows PATH
154
154
if : runner.os == 'Windows'
155
155
run : echo "$env:USERPROFILE\.cargo\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
156
156
157
+ - name : Check Rust shader formatting
158
+ working-directory : shaders/rust
159
+ run : |
160
+ rustup component add rustfmt
161
+ cargo fmt --all --check
162
+
157
163
- name : Compile shaders to SPIR-V
158
164
working-directory : shaders/rust
159
165
run : python3 compileshaders.py
160
-
166
+
161
167
- name : Verify no uncommitted changes
162
168
shell : bash
163
169
run : |
@@ -168,7 +174,7 @@ jobs:
168
174
git diff --name-only
169
175
exit 1
170
176
fi
171
-
177
+
172
178
# Check for untracked files
173
179
if [ -n "$(git ls-files --others --exclude-standard)" ]; then
174
180
echo "Error: New untracked files were generated"
0 commit comments