From 1b34482e4e04d71c690b5e2105b6b4bb32f3422a Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 26 Jun 2025 19:45:05 +0200 Subject: [PATCH] add basic CI --- .github/workflows/ci.yml | 47 +++++++++++++++++++ examples/embassy/Cargo.toml | 7 ++- .../embassy/src/bin/dht22-open-drain-pins.rs | 2 +- examples/zedboard/Cargo.toml | 5 +- zynq7000-embassy/Cargo.toml | 4 +- 5 files changed, 55 insertions(+), 10 deletions(-) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..46698e7 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,47 @@ +name: ci +on: [push, pull_request] + +jobs: + check: + name: Check build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@nightly + with: + components: rust-src + # Copy config file for rustflags and to build core/alloc. + - run: cp .cargo/def-config.toml .cargo/config.toml + - run: cargo check --target armv7a-none-eabihf -p zynq7000 + - run: cargo check --target armv7a-none-eabihf -p zynq7000-rt + + fmt: + name: Check formatting + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@nightly + with: + components: rustfmt + - run: cargo fmt --all -- --check + + docs: + name: Check Documentation Build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@nightly + - run: RUSTDOCFLAGS="--cfg docsrs --generate-link-to-definition -Z unstable-options" cargo +nightly doc -p zynq7000-rt --all-features + - run: RUSTDOCFLAGS="--cfg docsrs --generate-link-to-definition -Z unstable-options" cargo +nightly doc -p zynq7000 --all-features + + clippy: + name: Clippy + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@nightly + with: + components: clippy, rust-src + # Copy config file for rustflags and to build core/alloc. + - run: cp .cargo/def-config.toml .cargo/config.toml + - run: cargo clippy --target armv7a-none-eabihf -- -D warnings diff --git a/examples/embassy/Cargo.toml b/examples/embassy/Cargo.toml index c6577fa..34d6dc2 100644 --- a/examples/embassy/Cargo.toml +++ b/examples/embassy/Cargo.toml @@ -16,7 +16,7 @@ zynq7000-rt = { path = "../../zynq7000-rt" } zynq7000 = { path = "../../zynq7000" } zynq7000-hal = { path = "../../zynq7000-hal" } zynq7000-embassy = { path = "../../zynq7000-embassy" } -dht-sensor = { git = "https://github.com/robamu/dht-sensor.git", branch = "bump-embedded-hal-deps-update-async", features = ["async"] } +dht-sensor = { git = "https://github.com/michaelbeaumont/dht-sensor.git", rev = "10319bdeae9ace3bb0fc79a15da2869c5bf50f52", features = ["async"] } static_cell = "2" critical-section = "1" heapless = "0.8" @@ -25,12 +25,11 @@ embedded-hal = "1" fugit = "0.3" log = "0.4" -embassy-executor = { git = "https://github.com/us-irs/embassy", branch = "add-cortex-ar-support", features = [ +embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", branch = "main", features = [ "arch-cortex-ar", "executor-thread", - "task-arena-size-65536" ]} -embassy-time = { git = "https://github.com/us-irs/embassy", branch = "add-cortex-ar-support", version = "0.4", features = ["tick-hz-1_000_000"] } +embassy-time = { git = "https://github.com/embassy-rs/embassy.git", branch = "main", version = "0.4", features = ["tick-hz-1_000_000"] } [profile.release] codegen-units = 1 diff --git a/examples/embassy/src/bin/dht22-open-drain-pins.rs b/examples/embassy/src/bin/dht22-open-drain-pins.rs index 534d5f6..4b6e5d3 100644 --- a/examples/embassy/src/bin/dht22-open-drain-pins.rs +++ b/examples/embassy/src/bin/dht22-open-drain-pins.rs @@ -141,7 +141,7 @@ async fn main(_spawner: Spawner) -> ! { let mut led = Output::new_for_mio(mio_pins.mio7, PinState::Low); loop { if DHT22_AT_MIO0 { - let result = dht_sensor::dht22::asynch::read(&mut delay, &mut one_wire_pin).await; + let result = dht_sensor::dht22::r#async::read(&mut delay, &mut one_wire_pin).await; match result { Ok(reading) => { info!("Temperature: {} C", reading.temperature); diff --git a/examples/zedboard/Cargo.toml b/examples/zedboard/Cargo.toml index 0c1eb84..3f7160e 100644 --- a/examples/zedboard/Cargo.toml +++ b/examples/zedboard/Cargo.toml @@ -28,12 +28,11 @@ embedded-hal-async = "1" fugit = "0.3" log = "0.4" -embassy-executor = { git = "https://github.com/us-irs/embassy", branch = "add-cortex-ar-support", features = [ +embassy-executor = { git = "https://github.com/embassy-rs/embassy.git", branch = "main", features = [ "arch-cortex-ar", "executor-thread", - "task-arena-size-65536" ]} -embassy-time = { git = "https://github.com/us-irs/embassy", branch = "add-cortex-ar-support", version = "0.4", features = ["tick-hz-1_000_000"] } +embassy-time = { git = "https://github.com/embassy-rs/embassy.git", branch = "main", version = "0.4", features = ["tick-hz-1_000_000"] } heapless = "0.8" axi-uartlite = { git = "https://egit.irs.uni-stuttgart.de/rust/axi-uartlite.git" } axi-uart16550 = { git = "https://egit.irs.uni-stuttgart.de/rust/axi-uart16550.git" } diff --git a/zynq7000-embassy/Cargo.toml b/zynq7000-embassy/Cargo.toml index b771b45..eddca28 100644 --- a/zynq7000-embassy/Cargo.toml +++ b/zynq7000-embassy/Cargo.toml @@ -15,5 +15,5 @@ critical-section = "1" once_cell = { version = "1", default-features = false, features = ["critical-section"] } zynq7000-hal = { path = "../zynq7000-hal" } -embassy-time-driver = { git = "https://github.com/us-irs/embassy", branch = "add-cortex-ar-support", version = "0.2" } -embassy-time-queue-utils = { git = "https://github.com/us-irs/embassy", branch = "add-cortex-ar-support", version = "0.1" } +embassy-time-driver = { git = "https://github.com/embassy-rs/embassy.git", branch = "main", version = "0.2" } +embassy-time-queue-utils = { git = "https://github.com/embassy-rs/embassy.git", branch = "main", version = "0.1" }