diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml new file mode 100644 index 0000000..dbea474 --- /dev/null +++ b/.github/workflows/rust.yml @@ -0,0 +1,34 @@ +name: Rust + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +env: + CARGO_TERM_COLOR: always + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Install nightly rust + run: rustup toolchain install nightly + - name: Make nightly default + run: rustup default nightly + - name: Install build target + run: rustup target add thumbv7em-none-eabi + - name: Print installed toolchains + run: rustup show + - name: Build + run: cargo build --release --target thumbv7em-none-eabi + - name: Install test target + run: rustup target add aarch64-apple-darwin + - name: Add rust src + run: rustup component add rust-src --toolchain nightly-x86_64-unknown-linux-gnu + - name: Run tests + run: cargo test -Zbuild-std --target x86_64-unknown-linux-gnu diff --git a/shared/src/communication/eps.rs b/shared/src/communication/eps.rs index 14ebd95..e834907 100644 --- a/shared/src/communication/eps.rs +++ b/shared/src/communication/eps.rs @@ -75,8 +75,6 @@ impl CommandParseError { #[cfg(test)] mod tests { - use core::num::ParseIntError; - use crate::communication::eps::CommandParseError::*; #[test] @@ -102,6 +100,7 @@ mod tests { #[test] fn utf_8_error_as_bytes() { + #[allow(invalid_from_utf8)] let error = core::str::from_utf8(&[0xC0]).err().unwrap(); assert_eq!(b"err;504", Utf8Error(error).as_bytes()); }