Skip to content

Commit 403aead

Browse files
committed
fix: github ci
1 parent 1d93730 commit 403aead

File tree

1 file changed

+28
-41
lines changed

1 file changed

+28
-41
lines changed

.github/workflows/sdk_ci.yml

Lines changed: 28 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,38 @@
1-
name: CI
1+
name: Build and Test Rust Backend
22

3-
on:
4-
push:
5-
branches: ["main"]
6-
pull_request:
7-
types: ["opened", "synchronize", "reopened"]
8-
branches: ["main"]
3+
on: [push, pull_request]
4+
5+
permissions:
6+
contents: read
97

108
jobs:
11-
test:
12-
name: Sdk Tests
9+
ci:
1310
runs-on: ubuntu-latest
1411
steps:
1512
- uses: actions/checkout@v4
1613

17-
- name: Install the Rust toolchain
18-
uses: actions-rust-lang/setup-rust-toolchain@v1
14+
- uses: dtolnay/rust-toolchain@stable
15+
with:
16+
components: rustfmt, clippy
1917

20-
- name: Run tests
21-
run: cargo test --verbose
18+
- uses: actions/cache@v4
19+
with:
20+
path: |
21+
~/.cargo/registry/index/
22+
~/.cargo/registry/cache/
23+
~/.cargo/git/db/
24+
target/
25+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
26+
restore-keys: ${{ runner.os }}-cargo-
2227

23-
fmt:
24-
name: Rustfmt
25-
runs-on: ubuntu-latest
26-
steps:
27-
- uses: actions/checkout@v4
28+
- name: Format check
29+
run: cargo fmt --all -- --check
2830

29-
- name: Install the Rust toolchain
30-
uses: actions-rust-lang/setup-rust-toolchain@v1
31-
with:
32-
components: rustfmt
33-
cache: false
34-
35-
- name: Check formatting
36-
run: cargo fmt --check
37-
38-
# clippy:
39-
# name: Clippy
40-
# runs-on: ubuntu-latest
41-
# steps:
42-
# - uses: actions/checkout@v4
43-
44-
# - name: Install the Rust toolchain
45-
# uses: actions-rust-lang/setup-rust-toolchain@v1
46-
# with:
47-
# components: clippy
48-
# cache: false
49-
50-
# - name: Run clippy
51-
# run: cargo clippy -- -D warnings
31+
# - name: Clippy
32+
# run: cargo clippy --all-targets -- -D warnings
33+
34+
- name: Test
35+
run: cargo test
36+
37+
- name: Build
38+
run: cargo build --release

0 commit comments

Comments
 (0)