From c2b1896621f4af08889456ff5ea2c689843fd02c Mon Sep 17 00:00:00 2001 From: kuangjux <18630816527@163.com> Date: Wed, 15 May 2024 16:56:34 +0800 Subject: [PATCH] feat(ci): Add format ci. --- .github/workflows/build.yml | 25 +++++++++++++++++++++++++ Makefile | 2 +- thriller-core/src/engine/mod.rs | 1 + 3 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..7e4199b --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,25 @@ +name: Build CI + +on: [push, pull_request] + +jobs: + clippy: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + rust-toolchain: [stable] + steps: + - uses: actions/checkout@v2 + - name: Install Rust + uses: actions-rs/toolchain@v1 + with: + toolchain: ${{ matrix.rust-toolchain }} + components: clippy, rust-src, rustfmt + override: true + - name: Check rust version + run: rustc --version --verbose + - name: Run Clippy + run: cargo clippy --all-targets --all-features -- -D warnings + - name: Check code formatting + run: cargo fmt --all -- --check \ No newline at end of file diff --git a/Makefile b/Makefile index 496700e..d30836a 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -EXAMPLE ?= shared_block +EXAMPLE ?= global_block .PHONY: build test clean example diff --git a/thriller-core/src/engine/mod.rs b/thriller-core/src/engine/mod.rs index 3f51575..3575377 100644 --- a/thriller-core/src/engine/mod.rs +++ b/thriller-core/src/engine/mod.rs @@ -61,6 +61,7 @@ impl ThrillerEngine { pub fn emit_dataflow>(&self, sig: T) -> ThrillerResult { let mut code = String::new(); code += self.emit_function_signature(sig)?.as_str(); + code += "{\n"; code += "// Declare shared memory buffer\n"; code += Memory::emit_shared_buf_decl().as_str();