From bfc5b6b5475d359b8fc910516e026d972be5d02f Mon Sep 17 00:00:00 2001 From: Julian Gonzalez Calderon Date: Tue, 3 Dec 2024 17:02:34 -0300 Subject: [PATCH] Add basic CI (#24) * Add basic CI * Use nighly rustfmt * Fix format * Fix clippy * Rename job * Install lld * Remove all features * Only clippy blockifier --- .github/workflows/replay.yml | 49 +++++++++++++++++++ .../src/execution/contract_class.rs | 4 +- .../src/execution/execution_utils.rs | 12 ++--- 3 files changed, 56 insertions(+), 9 deletions(-) create mode 100644 .github/workflows/replay.yml diff --git a/.github/workflows/replay.yml b/.github/workflows/replay.yml new file mode 100644 index 0000000000..21e0ad9ad5 --- /dev/null +++ b/.github/workflows/replay.yml @@ -0,0 +1,49 @@ +name: Replay + +on: + push: + branches: [main, replay] + pull_request: + +jobs: + clippy: + runs-on: ubuntu-latest + env: + MLIR_SYS_190_PREFIX: /usr/lib/llvm-19/ + LLVM_SYS_191_PREFIX: /usr/lib/llvm-19/ + TABLEGEN_190_PREFIX: /usr/lib/llvm-19/ + CAIRO_NATIVE_RUNTIME_LIBRARY: libcairo_native_runtime.a + steps: + - uses: actions/checkout@v4 + with: + # required to clone native as a git submodule + submodules: recursive + - uses: dtolnay/rust-toolchain@1.82.0 + with: + components: clippy + - uses: Swatinem/rust-cache@v2 + - name: Add LLVM Debian repository + uses: myci-actions/add-deb-repo@10 + with: + repo: deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-19 main + repo-name: llvm-repo + keys-asc: https://apt.llvm.org/llvm-snapshot.gpg.key + - name: Install lld + run: sudo apt install lld + - name: Install LLVM + run: sudo apt-get install llvm-19 llvm-19-dev llvm-19-runtime clang-19 clang-tools-19 lld-19 libpolly-19-dev libmlir-19-dev mlir-19-tools + - name: Run cargo clippy + run: | + cd crates/blockifier + cargo clippy --all-targets --all-features --no-deps + + format: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@nightly + with: + toolchain: nightly-2023-10-19 + components: rustfmt + - name: Run cargo fmt + run: cargo +nightly-2023-10-19 fmt --all -- --check diff --git a/crates/blockifier/src/execution/contract_class.rs b/crates/blockifier/src/execution/contract_class.rs index cdb499dd9f..302e440968 100644 --- a/crates/blockifier/src/execution/contract_class.rs +++ b/crates/blockifier/src/execution/contract_class.rs @@ -96,9 +96,7 @@ impl RunnableCompiledClass { Self::V0(class) => class.estimate_casm_hash_computation_resources(), Self::V1(class) => class.estimate_casm_hash_computation_resources(), #[cfg(feature = "cairo_native")] - Self::V1Native(_) => { - ExecutionResources::default() - } + Self::V1Native(_) => ExecutionResources::default(), } } diff --git a/crates/blockifier/src/execution/execution_utils.rs b/crates/blockifier/src/execution/execution_utils.rs index 4b1279550f..7c093b91d6 100644 --- a/crates/blockifier/src/execution/execution_utils.rs +++ b/crates/blockifier/src/execution/execution_utils.rs @@ -148,12 +148,12 @@ pub fn execute_entry_point_call( // context, // ) // } else { - native_entry_point_execution::execute_entry_point_call( - call, - compiled_class, - state, - context, - ) + native_entry_point_execution::execute_entry_point_call( + call, + compiled_class, + state, + context, + ) // } } }