Skip to content

Commit

Permalink
Merge pull request #24 from iosis-tech/arm_riscv_support
Browse files Browse the repository at this point in the history
ARM RISCV support
  • Loading branch information
rkdud007 authored Jul 23, 2024
2 parents 4ff45aa + 97f225b commit 20dc157
Show file tree
Hide file tree
Showing 48 changed files with 3,253 additions and 1,088 deletions.
83 changes: 58 additions & 25 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
${{ runner.os }}-cargo-build-
- name: Run tests
run: cargo test --verbose
run: cargo test -rv

verify-proof:
runs-on: ubuntu-latest
Expand All @@ -52,6 +52,11 @@ jobs:
"starknet",
"starknet_with_keccak",
]

env:
PROOFS_DIR: ${{ github.workspace }}/examples/proofs
WORKING_DIR: ${{ github.workspace }}/cli

steps:
- name: Checkout repository
uses: actions/checkout@v3
Expand All @@ -78,27 +83,55 @@ jobs:
${{ runner.os }}-cargo-build-
- name: Run verification
run: cargo run --release --bin swiftness --features std,${{ matrix.layout }},keccak --no-default-features -- --proof examples/proofs/${{ matrix.layout }}/cairo0_example_proof.json

# no-std-build:
# name: Test no_std support
# runs-on: ubuntu-latest
# strategy:
# fail-fast: false
# matrix:
# layout:
# [
# "dex",
# "recursive",
# "recursive_with_poseidon",
# "small",
# "starknet",
# "starknet_with_keccak",
# ]
# steps:
# - uses: actions/checkout@v3
# - name: Check wasm compatibility
# run: |-
# cd examples/no_std_build
# rustup show
# cargo build -r --features ${{ matrix.layout }},keccak --no-default-features
run: cargo run -r --bin swiftness --features std,${{ matrix.layout }},keccak --no-default-features -- --proof ${{ env.PROOFS_DIR }}/${{ matrix.layout }}/cairo0_example_proof.json
working-directory: ${{ env.WORKING_DIR }}

no-std-build:
runs-on: ubuntu-latest
needs: verify-proof
strategy:
fail-fast: false
matrix:
layout: ["dex", "recursive", "recursive_with_poseidon", "small", "starknet", "starknet_with_keccak"]
hash: ["blake2s", "keccak"]
target: ["armebv7r-none-eabi", "riscv64imac-unknown-none-elf"]

env:
WORKING_DIR: ${{ github.workspace }}/examples/no_std_build

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Setup Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1

- name: Cache Cargo registry
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-registry-
- name: Cache Cargo build
uses: actions/cache@v2
with:
path: target
key: ${{ runner.os }}-cargo-build-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-build-
- name: Show rustup
run: rustup show
working-directory: ${{ env.WORKING_DIR }}

- name: Build project
run: cargo build -r --features ${{ matrix.layout }},${{ matrix.hash }} --no-default-features --target ${{ matrix.target }}
working-directory: ${{ env.WORKING_DIR }}

- name: Print binary metadata
run: file target/${{ matrix.target }}/release/no_std_build
working-directory: ${{ env.WORKING_DIR }}
4 changes: 2 additions & 2 deletions .github/workflows/npm_publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest

env:
WORKING_DIR: wasm_bindings # define the working directory here
WORKING_DIR: ${{ github.workspace }}/wasm_bindings

strategy:
fail-fast: false
Expand Down Expand Up @@ -51,7 +51,7 @@ jobs:
run: cargo install wasm-pack

- name: Build package
run: wasm-pack build --out-dir pkg --target web --workspace --features ${{ matrix.layout }},${{ matrix.hash }} --no-default-features
run: wasm-pack build --out-dir pkg --target web --features std,${{ matrix.layout }},${{ matrix.hash }} --no-default-features
working-directory: ${{ env.WORKING_DIR }}

- name: Rename package
Expand Down
Loading

0 comments on commit 20dc157

Please sign in to comment.