Skip to content

Commit 4cf1961

Browse files
committed
add ci
1 parent 287e580 commit 4cf1961

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed

.github/workflows/main.yml

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Rust
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
env:
10+
CARGO_TERM_COLOR: always
11+
RUST_CACHE_KEY: rust-cache-20250307
12+
CARGO_PROFILE_DEV_DEBUG: none
13+
14+
jobs:
15+
check-fmt:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v4
19+
- uses: dtolnay/rust-toolchain@stable
20+
with:
21+
components: rustfmt
22+
- name: Check formatting
23+
run: cargo fmt -- --check
24+
doc:
25+
runs-on: ubuntu-latest
26+
env:
27+
RUSTDOCFLAGS: -D warnings
28+
steps:
29+
- uses: actions/checkout@v4
30+
- uses: dtolnay/rust-toolchain@stable
31+
- uses: Swatinem/rust-cache@v2
32+
with:
33+
prefix-key: ${{ env.RUST_CACHE_KEY }}
34+
- run: sudo apt update && sudo apt-get install pkg-config libx11-dev libasound2-dev libudev-dev
35+
- name: Cargo doc
36+
run: cargo doc --no-deps
37+
test:
38+
runs-on: ubuntu-latest
39+
env:
40+
RUSTFLAGS: -D warnings
41+
steps:
42+
- uses: actions/checkout@v4
43+
- uses: dtolnay/rust-toolchain@stable
44+
with:
45+
components: clippy
46+
- uses: Swatinem/rust-cache@v2
47+
with:
48+
prefix-key: ${{ env.RUST_CACHE_KEY }}
49+
- run: sudo apt update && sudo apt-get install pkg-config libx11-dev libasound2-dev libudev-dev
50+
- name: Clippy
51+
run: cargo clippy --verbose --examples

0 commit comments

Comments
 (0)