-
Notifications
You must be signed in to change notification settings - Fork 1
33 lines (31 loc) · 957 Bytes
/
ci.yml
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
on:
push:
pull_request:
jobs:
rust:
name: Lint Rust code
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Cargo fmt
run: cargo fmt --all -- --check
- name: Cargo clippy
run: cargo clippy --workspace --all-targets -- -D warnings
- name: Cargo test
run: cargo test --workspace
generate-rust:
name: Generate Rust crate
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Clean
run: rm src/bindings.rs
- name: Generate bindings
run: cargo r -p bindings_generator
- name: Upload crate source
uses: actions/upload-artifact@v4
with:
name: crate-source
path: src/
- name: Diff generated Rust code
run: test -z "$(git status --porcelain)" || (echo "::error::Generated files are different, please regenerate with cargo run -p generate_bindings!"; git diff; false)