Skip to content

Commit d6e501f

Browse files
committed
CI?
1 parent be2365e commit d6e501f

File tree

1 file changed

+18
-25
lines changed

1 file changed

+18
-25
lines changed

.github/workflows/rust.yml

Lines changed: 18 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ on:
99
- master
1010

1111
env:
12-
CARGO_TERM_COLOR: always
12+
# For setup-rust, see https://github.com/moonrepo/setup-rust/issues/22
13+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1314

1415
jobs:
1516
test:
@@ -112,30 +113,26 @@ jobs:
112113
echo "VK_ICD_FILENAMES=$SWIFTSHADER_DEST_DIR\vk_swiftshader_icd.json" >> $GITHUB_ENV
113114
fi
114115
115-
- name: Install Rust via rustup
116-
shell: bash
116+
- name: Setup Rust
117+
uses: moonrepo/setup-rust@v1
118+
env:
119+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
120+
121+
- name: Install Rust toolchain
117122
run: |
118-
# Install rustup if not already installed
119-
if ! command -v rustup &> /dev/null; then
120-
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal
121-
source "$HOME/.cargo/env"
122-
fi
123-
124-
# Install stable toolchain with required components
125-
rustup toolchain install stable
126-
rustup component add rust-src rustc-dev llvm-tools --toolchain stable
127123
rustup default stable
124+
rustup update
125+
# Install nightly toolchain with required components for cargo-gpu
126+
rustup toolchain install nightly
127+
rustup component add rust-src rustc-dev llvm-tools --toolchain nightly
128128
129129
- name: Install cargo-gpu
130130
shell: bash
131+
env:
132+
RUST_LOG: debug
131133
run: |
132-
# Ensure cargo is in PATH
133-
source "$HOME/.cargo/env" || true
134-
135-
# Set non-interactive mode to avoid raw mode issues in CI
136-
export CARGO_TERM_COLOR=never
137-
export CI=true
138-
cargo install --git https://github.com/rust-gpu/cargo-gpu cargo-gpu
134+
# Install cargo-gpu with locked dependencies
135+
cargo install --git https://github.com/rust-gpu/cargo-gpu cargo-gpu --locked
139136
140137
- name: Cache cargo registry
141138
uses: actions/cache@v3
@@ -148,13 +145,9 @@ jobs:
148145
- name: Compile shaders to SPIR-V
149146
working-directory: shaders/rust
150147
shell: bash
148+
env:
149+
RUST_LOG: debug
151150
run: |
152-
# Ensure cargo is in PATH
153-
source "$HOME/.cargo/env" || true
154-
155-
# Set non-interactive mode for cargo-gpu
156-
export CARGO_TERM_COLOR=never
157-
export CI=true
158151
python3 compileshaders.py
159152
160153
- name: Verify no uncommitted changes

0 commit comments

Comments
 (0)