4747 - name : Protocol tests
4848 run : cargo test -p cake-core --test protocol
4949
50- build -android :
51- name : Build (Android aarch64)
50+ test -android :
51+ name : Test (Android aarch64)
5252 runs-on : ubuntu-latest
5353 permissions :
5454 contents : read
@@ -101,23 +101,17 @@ jobs:
101101 ANDROID_NDK_HOME : ${{ steps.setup-ndk.outputs.ndk-path }}
102102 run : cargo ndk -t aarch64-linux-android clippy -p cake-core --lib --no-default-features --features "llama,qwen2,qwen3_5" -p cake-mobile -- -D warnings
103103
104- - name : Compile tests (cake-core lib, Android)
105- env :
106- ANDROID_NDK_HOME : ${{ steps.setup-ndk.outputs.ndk-path }}
107- run : cargo ndk -t aarch64-linux-android test -p cake-core --lib --no-default-features --features "llama,qwen2,qwen3_5,qwen3,qwen3_moe,qwen3_5_moe,phi4,mistral,gemma3,falcon3,olmo2,exaone4,flux,vibevoice,luxtts" --no-run
104+ - name : Unit tests (cake-core lib)
105+ run : cargo test -p cake-core --lib
108106
109- - name : Compile tests (cake-core unit, Android)
110- env :
111- ANDROID_NDK_HOME : ${{ steps.setup-ndk.outputs.ndk-path }}
112- run : cargo ndk -t aarch64-linux-android test -p cake-core --test unit --no-default-features --features "llama,qwen2,qwen3_5,qwen3,qwen3_moe,qwen3_5_moe,phi4,mistral,gemma3,falcon3,olmo2,exaone4,flux,vibevoice,luxtts" --no-run
107+ - name : Unit tests (cake-core external)
108+ run : cargo test -p cake-core --test unit
113109
114- - name : Compile tests (cake-core protocol, Android)
115- env :
116- ANDROID_NDK_HOME : ${{ steps.setup-ndk.outputs.ndk-path }}
117- run : cargo ndk -t aarch64-linux-android test -p cake-core --test protocol --no-default-features --features "llama,qwen2,qwen3_5,qwen3,qwen3_moe,qwen3_5_moe,phi4,mistral,gemma3,falcon3,olmo2,exaone4,flux,vibevoice,luxtts" --no-run
110+ - name : Protocol tests
111+ run : cargo test -p cake-core --test protocol
118112
119- build -ios :
120- name : Build (iOS arm64)
113+ test -ios :
114+ name : Test (iOS arm64)
121115 runs-on : macos-latest
122116 permissions :
123117 contents : read
@@ -150,20 +144,106 @@ jobs:
150144 IPHONEOS_DEPLOYMENT_TARGET : " 16.0"
151145 run : cargo clippy --target=aarch64-apple-ios -p cake-core --lib --no-default-features --features "llama,qwen2,qwen3_5,metal" -p cake-mobile --features metal -- -D warnings
152146
153- - name : Compile tests (cake-core lib, iOS)
147+ - name : Unit tests (cake-core lib, Metal)
148+ run : cargo test -p cake-core --lib --features metal
149+
150+ - name : Unit tests (cake-core external, Metal)
151+ run : cargo test -p cake-core --test unit --features metal
152+
153+ - name : Protocol tests (Metal)
154+ run : cargo test -p cake-core --test protocol --features metal
155+
156+ test-features :
157+ name : Test (${{ matrix.name }})
158+ runs-on : ${{ matrix.os }}
159+ permissions :
160+ contents : read
161+ strategy :
162+ fail-fast : false
163+ matrix :
164+ include :
165+ - name : linux-cuda
166+ os : ubuntu-latest
167+ features : cuda
168+ cuda : " 12.4.0"
169+ compute_cap : " 89"
170+
171+ - name : linux-flash-attn
172+ os : ubuntu-latest
173+ features : flash-attn
174+ cuda : " 12.4.0"
175+ compute_cap : " 89"
176+
177+ - name : linux-vulkan
178+ os : ubuntu-latest
179+ features : vulkan
180+ cuda : " "
181+ compute_cap : " "
182+
183+ - name : linux-rocm
184+ os : ubuntu-latest
185+ features : rocm
186+ cuda : " "
187+ compute_cap : " "
188+
189+ - name : macos-metal
190+ os : macos-latest
191+ features : metal
192+ cuda : " "
193+ compute_cap : " "
194+
195+ steps :
196+ - uses : actions/checkout@v4
197+
198+ - name : Install Rust
199+ uses : dtolnay/rust-toolchain@stable
200+ with :
201+ components : clippy
202+
203+ - name : Install system dependencies (Linux)
204+ if : runner.os == 'Linux'
205+ run : sudo apt-get update && sudo apt-get install -y lld
206+
207+ - name : Install CUDA toolkit
208+ if : matrix.cuda != ''
209+ uses : Jimver/cuda-toolkit@v0.2.30
210+ with :
211+ cuda : ${{ matrix.cuda }}
212+ method : local
213+ linux-local-args : ' ["--toolkit"]'
214+ log-file-suffix : ' ${{ matrix.name }}.txt'
215+
216+ - name : Create CUDA runtime stub
217+ if : matrix.cuda != ''
218+ run : |
219+ STUBS_DIR="${CUDA_PATH}/lib64/stubs"
220+ sudo ln -s "${STUBS_DIR}/libcuda.so" "${STUBS_DIR}/libcuda.so.1"
221+ echo "LD_LIBRARY_PATH=${STUBS_DIR}:${LD_LIBRARY_PATH}" >> "$GITHUB_ENV"
222+
223+ - name : Cache cargo registry & build
224+ uses : actions/cache@v4
225+ with :
226+ path : |
227+ ~/.cargo/registry
228+ ~/.cargo/git
229+ target
230+ key : ${{ runner.os }}-cargo-${{ matrix.name }}-${{ hashFiles('**/Cargo.lock') }}
231+ restore-keys : ${{ runner.os }}-cargo-${{ matrix.name }}-
232+
233+ - name : Unit tests (cake-core lib)
154234 env :
155- IPHONEOS_DEPLOYMENT_TARGET : " 16.0 "
156- run : cargo test --target=aarch64-apple-ios - p cake-core --lib --no-default- features -- features "llama,qwen2,qwen3_5,qwen3,qwen3_moe,qwen3_5_moe,phi4,mistral,gemma3,falcon3,olmo2,exaone4,flux,vibevoice,luxtts,metal" --no-run
235+ CUDA_COMPUTE_CAP : ${{ matrix.compute_cap }}
236+ run : cargo test -p cake-core --lib --features "${{ matrix. features }}"
157237
158- - name : Compile tests (cake-core unit, iOS )
238+ - name : Unit tests (cake-core external )
159239 env :
160- IPHONEOS_DEPLOYMENT_TARGET : " 16.0 "
161- run : cargo test --target=aarch64-apple-ios - p cake-core --test unit --no-default- features -- features "llama,qwen2,qwen3_5,qwen3,qwen3_moe,qwen3_5_moe,phi4,mistral,gemma3,falcon3,olmo2,exaone4,flux,vibevoice,luxtts,metal" --no-run
240+ CUDA_COMPUTE_CAP : ${{ matrix.compute_cap }}
241+ run : cargo test -p cake-core --test unit --features "${{ matrix. features }}"
162242
163- - name : Compile tests (cake-core protocol, iOS)
243+ - name : Protocol tests
164244 env :
165- IPHONEOS_DEPLOYMENT_TARGET : " 16.0 "
166- run : cargo test --target=aarch64-apple-ios - p cake-core --test protocol --no-default- features -- features "llama,qwen2,qwen3_5,qwen3,qwen3_moe,qwen3_5_moe,phi4,mistral,gemma3,falcon3,olmo2,exaone4,flux,vibevoice,luxtts,metal" --no-run
245+ CUDA_COMPUTE_CAP : ${{ matrix.compute_cap }}
246+ run : cargo test -p cake-core --test protocol --features "${{ matrix. features }}"
167247
168248 clippy :
169249 name : Clippy
@@ -186,5 +266,5 @@ jobs:
186266 key : ${{ runner.os }}-cargo-clippy-${{ hashFiles('**/Cargo.lock') }}
187267 restore-keys : ${{ runner.os }}-cargo-clippy-
188268
189- - name : Clippy (cake-core + cake-cli)
190- run : cargo clippy -p cake-core --lib --tests -p cake-cli -- -D warnings
269+ - name : Clippy (cake-core + cake-cli, all features )
270+ run : cargo clippy -p cake-core --lib --tests -p cake-cli --features "vulkan,rocm" -- -D warnings
0 commit comments