-
Notifications
You must be signed in to change notification settings - Fork 5
59 lines (49 loc) · 1.7 KB
/
Copy pathrust.yml
File metadata and controls
59 lines (49 loc) · 1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
name: Rust CI
on: [push, pull_request]
jobs:
rust:
runs-on: ubuntu-latest
steps:
- name: Checkout (with libilbc submodule)
uses: actions/checkout@v5
with:
submodules: recursive
# build.rs links libspandsp (G.722) and libilbc (iLBC). Ubuntu
# packages spandsp; libilbc has no package, so build it from the
# in-repo submodule and install the .so + dev symlink into
# /usr/local where build.rs looks.
- name: Install native deps
run: |
sudo apt-get update
sudo apt-get install -y cmake build-essential libspandsp-dev
cd libilbc
cmake . -DCMAKE_INSTALL_LIBDIR=/usr/local/lib -DCMAKE_INSTALL_INCLUDEDIR=/usr/local/include
cmake --build .
sudo cmake --install .
sudo ldconfig
# CI runs glibc, so the musl-only rustls ICE that pins the Docker
# image to 1.92 does not apply here — stable is fine.
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Cache cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
rust/target
key: ${{ runner.os }}-cargo-${{ hashFiles('rust/Cargo.lock') }}
- name: rustfmt
working-directory: rust
run: cargo fmt --all -- --check
- name: clippy
working-directory: rust
run: cargo clippy --all-targets --locked -- -D warnings
- name: check
working-directory: rust
run: cargo check --all-targets --locked
- name: test
working-directory: rust
run: cargo test --lib --locked