Skip to content

Commit

Permalink
Run cargo check in CI in stable rust and msrv of the crate
Browse files Browse the repository at this point in the history
  • Loading branch information
barakugav committed Nov 1, 2024
1 parent 4180fad commit 1185f4a
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 3 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/develop.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,53 @@ jobs:
# python export_model.py
run: cargo run
working-directory: examples/hello_world_add_no_std

rust-version-check-clippy:
# check that we can build using different rust versions:
# - the minimal rust version that is specified by this crate
# - the latest stable version
runs-on: ubuntu-latest
strategy:
matrix:
rust-version: ["msrv", "stable"]
steps:
- uses: actions/checkout@v4
- name: Determine Rust version
id: rust-version
run: |
if [ "${{ matrix.rust-version }}" = "stable" ]; then
rust_version="stable"
else
cargo install toml-cli
rust_version=$(toml get Cargo.toml package.rust-version --raw)
fi
echo "Rust version: '$rust_version'"
echo "rust_version=$rust_version" >> "$GITHUB_OUTPUT"
- name: Install Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: ${{ steps.rust-version.outputs.rust_version }}
components: clippy
cache-workspaces:
./
executorch-sys
examples/hello_world_add
examples/hello_world_add_no_std

- name: cargo check executorch
run: cargo check
working-directory: .
- name: cargo clippy executorch
uses: auguwu/clippy-action@1.4.0
with:
working-directory: .
token: ${{ secrets.GITHUB_TOKEN }}

- name: cargo check executorch-sys
run: cargo check
working-directory: executorch-sys
- name: cargo clippy executorch-sys
uses: auguwu/clippy-action@1.4.0
with:
working-directory: executorch-sys
token: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name = "executorch"
version = "0.3.0"
authors = ["Barak Ugav <barakugav@gmail.com>"]
edition = "2021"
rust-version = "1.70" # `half` crate
description = "Rust bindings for ExecuTorch - On-device AI across mobile, embedded and edge for PyTorch"
readme = "README.md"
repository = "https://github.com/barakugav/executorch-rs"
Expand Down
6 changes: 3 additions & 3 deletions executorch-sys/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@
//! ## Cargo Features
//! By default all features are disabled.
//! - `data-loader`: Includes the [`FileDataLoader`] and [`MmapDataLoader`] structs. Without this feature the only available
//! data loader is [`BufferDataLoader`]. The `libextension_data_loader.a` static library is required, compile C++
//! `executorch` with `EXECUTORCH_BUILD_EXTENSION_DATA_LOADER=ON`.
//! data loader is [`BufferDataLoader`]. The `libextension_data_loader.a` static library is required, compile C++
//! `executorch` with `EXECUTORCH_BUILD_EXTENSION_DATA_LOADER=ON`.
//! - `module`: Includes the [`Module`] struct. The `libextension_module_static.a` static library is required, compile C++
//! `executorch` with `EXECUTORCH_BUILD_EXTENSION_MODULE=ON`.
//! ` executorch` with `EXECUTORCH_BUILD_EXTENSION_MODULE=ON`.

Check failure on line 85 in executorch-sys/src/lib.rs

View workflow job for this annotation

GitHub Actions / rust-version-check-clippy (stable)

doc list item without indentation

error: doc list item without indentation --> src/lib.rs:85:5 | 85 | //! ` executorch` with `EXECUTORCH_BUILD_EXTENSION_MODULE=ON`. | ^ | = help: if this is supposed to be its own paragraph, add a blank line = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation = note: `-D clippy::doc-lazy-continuation` implied by `-D warnings` = help: to override `-D warnings` add `#[allow(clippy::doc_lazy_continuation)]` help: indent this line | 85 | //! ` executorch` with `EXECUTORCH_BUILD_EXTENSION_MODULE=ON`. | ++
//!
//! [`FileDataLoader`]: crate::torch::executor::util::FileDataLoader
//! [`MmapDataLoader`]: crate::torch::executor::util::MmapDataLoader
Expand Down

0 comments on commit 1185f4a

Please sign in to comment.