diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml new file mode 100644 index 0000000..7fc74d3 --- /dev/null +++ b/.github/workflows/rust.yml @@ -0,0 +1,42 @@ +name: Rust + +on: + push: + branches: ["main"] + pull_request: + branches: ["main"] + +env: + CARGO_TERM_COLOR: always + RUSTFLAGS: "-Dwarnings" + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install Rust + uses: dtolnay/rust-toolchain@master + with: + toolchain: stable + components: clippy + - uses: Swatinem/rust-cache@v2 + + - name: Build + run: cargo build --verbose + - name: Run Clippy + run: cargo clippy --all-targets --all-features + - name: Run tests + run: cargo test --verbose + + rust_fmt: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install Rust + uses: dtolnay/rust-toolchain@master + with: + toolchain: stable + components: rustfmt + - name: Run rust fmt + run: cargo fmt --all -- --check diff --git a/crates/core/src/context.rs b/crates/core/src/context.rs index bb73387..b106c6d 100644 --- a/crates/core/src/context.rs +++ b/crates/core/src/context.rs @@ -44,7 +44,8 @@ impl Context { pub async fn from_topic(&self, topic: TopicReader) -> Result { let topic_name = topic.0.topic.clone(); - self.register_table(topic_name.clone(), Arc::new(topic)).await?; + self.register_table(topic_name.clone(), Arc::new(topic)) + .await?; let df = self .session_conext diff --git a/crates/core/src/datastream.rs b/crates/core/src/datastream.rs index 5542f3f..c50f25d 100644 --- a/crates/core/src/datastream.rs +++ b/crates/core/src/datastream.rs @@ -80,7 +80,8 @@ impl DataStream { .await?; self.context - .register_table(topic.clone(), Arc::new(sink_topic)).await?; + .register_table(topic.clone(), Arc::new(sink_topic)) + .await?; self.df .as_ref()