Skip to content
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
58 changes: 58 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Setup Environment
description: Setup Rust, Node.js, Circom and SnarkJS for testing

inputs:
rust-toolchain:
description: "Rust toolchain version"
required: false
default: "1.90.0"
node-version:
description: "Node.js version"
required: false
default: "22"
circom-version:
description: "Circom version"
required: false
default: "v2.2.2"

runs:
using: composite
steps:
- name: Install Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: ${{ inputs.rust-toolchain }}

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node-version }}

- name: Cache circom installation
id: cache-circom
uses: actions/cache@v4
with:
path: ~/.cargo/bin/circom
key: circom-${{ runner.os }}-${{ inputs.circom-version }}

- name: Install circom
if: steps.cache-circom.outputs.cache-hit != 'true'
shell: bash
run: |
wget -q https://github.com/iden3/circom/releases/download/${{ inputs.circom-version }}/circom-linux-amd64
chmod +x circom-linux-amd64
mv circom-linux-amd64 ~/.cargo/bin/circom

- name: Install snarkjs
shell: bash
run: npm install -g snarkjs

- name: Display versions
shell: bash
run: |
rustc --version
cargo --version
node --version
npm --version
circom --version
snarkjs --help | head -1 || true
47 changes: 47 additions & 0 deletions .github/workflows/rust-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Rust

on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened]
branches:
- master

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
RUST_TOOLCHAIN: "1.90.0"
NODE_VERSION: "22"
CIRCOM_VERSION: "v2.2.2"

jobs:
test-rust:
name: Test Workspace
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup environment
uses: ./.github/actions/setup
with:
rust-toolchain: ${{ env.RUST_TOOLCHAIN }}
node-version: ${{ env.NODE_VERSION }}
circom-version: ${{ env.CIRCOM_VERSION }}

- name: Install npm dependencies (for circuit compilation)
working-directory: tests/rust-vk
run: npm install

- name: Compile circuit and generate keys
working-directory: tests/rust-vk
run: npm run build-all

- name: Build workspace
run: cargo build --workspace

- name: Test workspace
run: cargo test --workspace
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
target
node_modules
node_modules
pot
build
.DS_Store
Loading