Skip to content

Commit

Permalink
fix: apply some of the CI fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
varex83 committed Aug 20, 2024
1 parent 3403746 commit 79a2872
Show file tree
Hide file tree
Showing 8 changed files with 70 additions and 3 deletions.
41 changes: 41 additions & 0 deletions .github/actions/setup-native-deps/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: "Setup Cairo Native Dependencies"
description: "Sets up LLVM and GMP libraries"

outputs:
cairo-native-runtime-library:
description: "The path to the cairo native runtime library"
value: ${{ steps.set-env-vars.outputs.cairo-native-runtime-library }}
runs:
using: "composite"
steps:
- name: Add llvm deb repository
uses: myci-actions/add-deb-repo@11
with:
repo: deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-18 main
repo-name: llvm-repo
keys-asc: https://apt.llvm.org/llvm-snapshot.gpg.key
- name: Install LLVM and gmplib
shell: bash
run: |
sudo apt-get update
sudo apt-get install llvm-18 llvm-18-dev llvm-18-runtime clang-18 clang-tools-18 lld-18 libpolly-18-dev libmlir-18-dev mlir-18-tools
sudo apt-get install -y libgmp3-dev
- name: Fetch Cairo Native Repository
uses: actions/checkout@v3
with:
repository: "lambdaclass/cairo_native"
ref: "cairo-lang2.7.0-rc.3"
path: "cairo_native"
- name: Install Cairo Native Runtime Dependencies
id: set-env-vars
shell: bash
run: |
cd ./cairo_native &&
echo "cairo-native-runtime-library=$(pwd)/target/release/libcairo_native_runtime.a" >> $GITHUB_OUTPUT &&
echo "CAIRO_NATIVE_RUNTIME_LIBRARY=$(pwd)/target/release/libcairo_native_runtime.a" >> $GITHUB_ENV &&
echo "MLIR_SYS_180_PREFIX=/usr/lib/llvm-18/" >> $GITHUB_ENV &&
echo "LLVM_SYS_181_PREFIX=/usr/lib/llvm-18/" >> $GITHUB_ENV &&
echo "TABLEGEN_180_PREFIX=/usr/lib/llvm-18/" >> $GITHUB_ENV &&
cd ./runtime &&
cargo build --release
3 changes: 3 additions & 0 deletions .github/workflows/blockifier_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/install_rust
- name: Set up Native Dependencies
uses: ./.github/actions/setup-native-deps
id: native-deps
- uses: Swatinem/rust-cache@v2
with:
prefix-key: "v0-rust-ubuntu-20.04"
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/blockifier_compiled_cairo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ jobs:
with:
toolchain: nightly-2023-07-05

- name: set up native dependencies
uses: ./.github/actions/setup-native-deps
id: native-deps

- name: Verify cairo contract recompilation (both cairo versions).
run:
cd sequencer &&
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/blockifier_coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/install_rust
- name: Set up Native Dependencies
uses: ./.github/actions/setup-native-deps
id: native-deps
- uses: Swatinem/rust-cache@v2
with:
prefix-key: "v0-rust-ubuntu-20.04"
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/blockifier_post-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ jobs:
- uses: Swatinem/rust-cache@v2
with:
prefix-key: "v0-rust-ubuntu-20.04"

- name: Set up Native Dependencies
uses: ./.github/actions/setup-native-deps
id: native-deps

# Setup pypy and link to the location expected by .cargo/config.toml.
- uses: actions/setup-python@v5
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ jobs:
- uses: ./.github/actions/install_rust
with:
components: clippy
- name: Set up Native Dependencies
uses: ./.github/actions/setup-native-deps
id: native-deps
- uses: Swatinem/rust-cache@v2
with:
prefix-key: "v0-rust-ubuntu-20.04"
Expand All @@ -84,6 +87,9 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/install_rust
- name: Set up Native Dependencies
uses: ./.github/actions/setup-native-deps
id: native-deps
- uses: Swatinem/rust-cache@v2
- uses: Noelware/setup-protoc@1.1.0
with:
Expand All @@ -98,6 +104,9 @@ jobs:
# Fetch the entire history.
fetch-depth: 0
- uses: ./.github/actions/install_rust
- name: Set up Native Dependencies
uses: ./.github/actions/setup-native-deps
id: native-deps
- uses: Noelware/setup-protoc@1.1.0
- uses: Swatinem/rust-cache@v2
with:
Expand Down Expand Up @@ -160,6 +169,9 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/install_rust
- name: Set up Native Dependencies
uses: ./.github/actions/setup-native-deps
id: native-deps
- uses: Swatinem/rust-cache@v2
- uses: Noelware/setup-protoc@1.1.0
with:
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,13 @@ bytes = "1"
cached = "0.44.0"
cairo-felt = "0.9.1"
# This is a temporary dependency, will be removed once the new version of cairo-native is released to main.
cairo-native = { git = "https://github.com/lambdaclass/cairo_native", branch = "cairo-lang2.7.0-rc.3" }
cairo-lang-casm = "2.7.0"
cairo-lang-runner = "2.7.0"
cairo-lang-sierra = "=2.7.0"
cairo-lang-sierra-to-casm = "2.7.0"
cairo-lang-starknet-classes = "2.7.0"
cairo-lang-utils = "2.7.0"
cairo-native = { git = "https://github.com/lambdaclass/cairo_native", branch = "cairo-lang2.7.0-rc.3" }
cairo-vm = "=1.0.0-rc6"
camelpaste = "0.1.0"
chrono = "0.4.26"
Expand Down
4 changes: 2 additions & 2 deletions crates/blockifier/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ ark-ff.workspace = true
ark-secp256k1.workspace = true
ark-secp256r1.workspace = true
cached.workspace = true
cairo-native.workspace = true
cairo-lang-casm = { workspace = true, features = ["parity-scale-codec"] }
cairo-lang-runner.workspace = true
cairo-lang-starknet-classes.workspace = true
cairo-lang-sierra.workspace = true
cairo-lang-starknet-classes.workspace = true
cairo-lang-utils.workspace = true
cairo-native.workspace = true
cairo-vm.workspace = true
derive_more.workspace = true
indexmap.workspace = true
Expand Down

0 comments on commit 79a2872

Please sign in to comment.