Skip to content

Commit b18163e

Browse files
author
wangbaiping(wbpcode)
committed
add lint/test/build workflow
Signed-off-by: wangbaiping(wbpcode) <wangbaiping@bytedance.com>
1 parent 8374a94 commit b18163e

3 files changed

Lines changed: 339 additions & 347 deletions

File tree

.github/workflows/commit.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Commit
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
dynamic_rust:
11+
name: Dynamic Rust module lint/test/build on (${{ matrix.platform.arch }})
12+
runs-on: ${{ matrix.platform.os }}
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
platform:
17+
- os: ubuntu-24.04
18+
arch: amd64
19+
- os: ubuntu-24.04-arm
20+
arch: arm64
21+
steps:
22+
- name: Checkout repository
23+
uses: actions/checkout@v4
24+
- name: Cache Cargo registry
25+
uses: actions/cache@v4
26+
with:
27+
path: ~/.cargo/registry
28+
key: ${{ matrix.platform.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
29+
restore-keys: |
30+
${{ matrix.platform.os }}-cargo-registry-
31+
- name: Cache Cargo git index
32+
uses: actions/cache@v4
33+
with:
34+
path: ~/.cargo/git
35+
key: ${{ matrix.platform.os }}-cargo-git-${{ hashFiles('**/Cargo.lock') }}
36+
restore-keys: |
37+
${{ matrix.platform.os }}-cargo-git-
38+
- name: Set up Rust toolchain
39+
uses: actions-rs/toolchain@v1
40+
with:
41+
toolchain: stable
42+
override: true
43+
components: clippy, rustfmt
44+
- name: Check format
45+
run: cargo fmt -- --check
46+
- name: Run Clippy linter
47+
run: cargo clippy -- -D warnings
48+
- name: Build module
49+
run: cargo build --verbose
50+
- name: Run tests
51+
run: cargo test --verbose

0 commit comments

Comments
 (0)