oskarth 1a383b6260
Ensure Circom 1 tests pass with experimental Circom 2 support (#18)
* All tests pass under circom-2 feature flag

- Check for version in WASM, default to version 1
- Include Circom1 when Circom 2 feature flag is enabled

Currently a lot of code duplication. Once Circom-2 is more stable and
proven to work in the wild, feature flag can be removed.

* Separate Circom 1 and Circom2 witness calculation

* Cleanup

* WitnessCalculator helpers for Circom 1 and 2

Also make helper fn private

* Move comment

* Fix expression return

* cargo fmt

* Add cargo test circom-2 to ci
2022-01-13 13:30:00 +02:00

68 lines
1.6 KiB
YAML

on:
push:
branches:
- master
pull_request:
name: Tests
jobs:
tests:
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Install node
uses: actions/setup-node@v1
with:
node-version: 10
- name: Install ganache
run: npm install -g ganache-cli
- name: Install Solc
run: |
mkdir -p "$HOME/bin"
wget -q https://github.com/ethereum/solidity/releases/download/v0.7.6/solc-static-linux -O $HOME/bin/solc
chmod u+x "$HOME/bin/solc"
export PATH=$HOME/bin:$PATH
solc --version
- uses: Swatinem/rust-cache@v1
with:
cache-on-failure: true
- name: cargo test
run: |
export PATH=$HOME/bin:$PATH
cargo test
- name: cargo test circom 2 feature flag
run: |
export PATH=$HOME/bin:$PATH
cargo test --features circom-2
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt, clippy
- name: cargo fmt
run: cargo fmt --all -- --check
- name: cargo clippy
run: cargo clippy -- -D warnings