Skip to content

Commit 6f4c57b

Browse files
committed
Add CI workflow: fmt, build, test, clippy (CPU only)
1 parent b38c6cf commit 6f4c57b

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

.github/workflows/ci.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
branches: [master]
8+
9+
env:
10+
CARGO_TERM_COLOR: always
11+
12+
jobs:
13+
check:
14+
name: Check & Test
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- uses: dtolnay/rust-toolchain@stable
20+
21+
- uses: Swatinem/rust-cache@v2
22+
23+
# Candle deps use local path refs that don't exist in CI.
24+
# Swap them for the matching crates.io release.
25+
- name: Patch candle deps for CI
26+
run: |
27+
sed -i 's|candle-core = { path = "[^"]*" }|candle-core = "0.9"|' Cargo.toml
28+
sed -i 's|candle-nn = { path = "[^"]*" }|candle-nn = "0.9"|' Cargo.toml
29+
sed -i 's|candle-transformers = { path = "[^"]*" }|candle-transformers = "0.9"|' Cargo.toml
30+
31+
- name: Check formatting
32+
run: cargo fmt -- --check
33+
34+
- name: Build (CPU only)
35+
run: cargo build --no-default-features
36+
37+
- name: Run tests
38+
run: cargo test --no-default-features
39+
40+
- name: Clippy
41+
run: cargo clippy --no-default-features -- -D warnings

0 commit comments

Comments
 (0)