forked from SaschaWillems/Vulkan
-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (53 loc) · 1.71 KB
/
rust.yml
File metadata and controls
63 lines (53 loc) · 1.71 KB
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
name: Rust CI
on:
push:
branches:
- master
pull_request:
branches:
- master
env:
CARGO_TERM_COLOR: always
jobs:
test:
name: Test Rust Shaders
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@v4
with:
submodules: "recursive"
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
components: rust-src, rustc-dev, llvm-tools
- name: Install cargo-gpu
run: cargo install --git https://github.com/rust-gpu/cargo-gpu cargo-gpu
- name: Cache cargo registry
uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Compile shaders to SPIR-V
working-directory: shaders/rust
run: python3 compileshaders.py
- name: Verify no uncommitted changes
run: |
# Check if there are any changes to tracked files
if ! git diff --exit-code; then
echo "Error: Generated SPIR-V files differ from checked-in versions"
echo "Please run 'python3 compileshaders.py' locally and commit the changes"
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"
echo "Please add these files to git or update .gitignore:"
git ls-files --others --exclude-standard
exit 1
fi