Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ARM RISCV support #24

Merged
merged 7 commits into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading