Skip to content

update native

update native #303

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
merge_group:
types: [checks_requested]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
jobs:
check:
name: clippy
runs-on: ubuntu-24.04
env:
MLIR_SYS_190_PREFIX: /usr/lib/llvm-19/
LLVM_SYS_191_PREFIX: /usr/lib/llvm-19/
TABLEGEN_190_PREFIX: /usr/lib/llvm-19/
steps:
- uses: actions/checkout@v4
- uses: dtolnay/[email protected]
with:
components: clippy, rustfmt
- uses: Swatinem/rust-cache@v2
- name: Add LLVM Debian repository
uses: myci-actions/add-deb-repo@11
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 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: Clippy
run: cargo clippy --all-targets --all-features -- -D warnings
format:
name: rustfmt
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: dtolnay/[email protected]
with:
components: rustfmt
- run: cargo fmt --all -- --check
- name: Find Comment
continue-on-error: true
if: success() || failure()
uses: peter-evans/find-comment@v3
id: fc
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: 'github-actions[bot]'
body-includes: thiscommentistofindthisformatcomment
- name: Create or update comment
continue-on-error: true
if: failure()
uses: peter-evans/create-or-update-comment@v4
with:
comment-id: ${{ steps.fc.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
body: |
❌ Code is not formatted! Please run `cargo format` and push the changes.
<!-- thiscommentistofindthisformatcomment -->
edit-mode: replace
- name: Create or update comment
continue-on-error: true
if: ${{ success() && steps.fc.outputs.comment-id != null }}
uses: peter-evans/create-or-update-comment@v4
with:
comment-id: ${{ steps.fc.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
body: |
✅ Code is now correctly formatted.
<!-- thiscommentistofindthisformatcomment -->
edit-mode: replace
# Check for unnecessary dependencies.
udeps:
runs-on: ubuntu-24.04
env:
MLIR_SYS_190_PREFIX: /usr/lib/llvm-19/
LLVM_SYS_191_PREFIX: /usr/lib/llvm-19/
TABLEGEN_190_PREFIX: /usr/lib/llvm-19/
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly
components: rustfmt
- name: add llvm deb repository
uses: myci-actions/add-deb-repo@11
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 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: Machete
uses: bnjbvr/cargo-machete@main
test:
name: test (linux, amd64)
runs-on: ubuntu-24.04
env:
MLIR_SYS_190_PREFIX: /usr/lib/llvm-19/
LLVM_SYS_191_PREFIX: /usr/lib/llvm-19/
TABLEGEN_190_PREFIX: /usr/lib/llvm-19/
RPC_ENDPOINT_TESTNET: ${{ secrets.RPC_ENDPOINT_TESTNET }}
RPC_ENDPOINT_MAINNET: ${{ secrets.RPC_ENDPOINT_MAINNET }}
RUST_LOG: debug,replay=trace,rpc-state-reader=trace
steps:
- uses: actions/checkout@v4
- name: Setup rust env
uses: dtolnay/[email protected]
- name: Retreive cached dependecies
uses: Swatinem/rust-cache@v2
- name: Add LLVM Debian repository
uses: myci-actions/add-deb-repo@11
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
- run: sudo apt-get update && sudo apt-get upgrade -y
- 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: Checkout cairo_native
uses: actions/checkout@v4
with:
repository: lambdaclass/cairo_native
ref: 0e251c56b8bb0c9c74c6de24575b21a5df2ba881
path: cairo_native
- name: Build Cairo Native Runtime Library
shell: bash
run: |
cd cairo_native
make runtime
echo "CAIRO_NATIVE_RUNTIME_LIBRARY=$(pwd)/libcairo_native_runtime.a" >> $GITHUB_ENV
- name: Test
run: cargo test --all-features
test_macos:
name: Test (macOS, Apple silicon)
runs-on: macos-14
env:
LIBRARY_PATH: /opt/homebrew/lib
MLIR_SYS_190_PREFIX: /opt/homebrew/opt/llvm@19
LLVM_SYS_191_PREFIX: /opt/homebrew/opt/llvm@19
TABLEGEN_190_PREFIX: /opt/homebrew/opt/llvm@19
RPC_ENDPOINT_TESTNET: ${{ secrets.RPC_ENDPOINT_TESTNET }}
RPC_ENDPOINT_MAINNET: ${{ secrets.RPC_ENDPOINT_MAINNET }}
RUST_LOG: debug,replay=trace,rpc-state-reader=trace
steps:
- uses: actions/checkout@v4
- name: Setup rust env
uses: dtolnay/[email protected]
- name: Rust `$PATH` workaround.
run: echo "$HOME/.cargo/bin" >> $GITHUB_PATH
- uses: Homebrew/actions/setup-homebrew@master
- name: Retreive cached dependecies
uses: Swatinem/rust-cache@v2
- name: Install LLVM
run: brew install llvm@19 --quiet
- name: Checkout cairo_native
uses: actions/checkout@v4
with:
repository: lambdaclass/cairo_native
ref: 0e251c56b8bb0c9c74c6de24575b21a5df2ba881
path: cairo_native
- name: Build Cairo Native Runtime Library
run: |
cd cairo_native
make runtime
echo "CAIRO_NATIVE_RUNTIME_LIBRARY=$(pwd)/libcairo_native_runtime.a" >> "$GITHUB_ENV"
- name: Test
run: cargo test --all-features