CI: Build-test documentation #209
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
- name: Cargo doc | |
run: cargo doc --workspace --all-features --no-deps --document-private-items | |
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) |