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

chore: clean up #74

Merged
merged 7 commits into from
Nov 18, 2023
Merged
Show file tree
Hide file tree
Changes from 4 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
77 changes: 77 additions & 0 deletions .github/workflows/circom.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: Circom checks
on:
workflow_dispatch:

push:
branches: [main]

pull_request:
branches: [main]

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

jobs:
checks:
strategy:
fail-fast: false
matrix:
node-version: [18]
command: ["prettier", "types", "test:coverage"]

runs-on: ubuntu-latest

timeout-minutes: 240

steps:
- uses: actions/checkout@v4

- name: Clone circom repository
uses: actions/checkout@v4
with:
repository: iden3/circom
path: ./circom

- uses: pnpm/action-setup@v2
with:
version: latest

- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- uses: dtolnay/rust-toolchain@nightly
with:
components: "clippy, rustfmt"

- name: Cache circom
uses: actions/cache@v3
id: circom-cache
continue-on-error: true
with:
path: |
~/.cargo/bin/circom
key: ${{ runner.os }}-circom-${{ hashFiles('./circom/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-circom-

- name: Install circom
if: steps.circom-cache.outputs.cache-hit != 'true'
run: |
cargo build --release
cargo install --path circom
working-directory: ./circom


- name: Build javascript
run: |
pnpm install --no-frozen-lockfile --prefer-offline
pnpm run build
working-directory: "./javascript"

- name: Check circom
run: |
pnpm install --no-frozen-lockfile --prefer-offline
pnpm run ${{ matrix.command }}
working-directory: "./circuits/circom"
41 changes: 41 additions & 0 deletions .github/workflows/javascript.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Javascript checks
on:
workflow_dispatch:

push:
branches: [main]

pull_request:
branches: [main]

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

jobs:
checks:
strategy:
fail-fast: false
matrix:
node-version: [18]
command: ["prettier", "types", "test:coverage"]

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- uses: pnpm/action-setup@v2
with:
version: latest

- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: Check javascript
run: |
pnpm install --no-frozen-lockfile --prefer-offline
pnpm run build
pnpm run ${{ matrix.command }}
working-directory: "./javascript"
18 changes: 0 additions & 18 deletions .github/workflows/npm.yml

This file was deleted.

38 changes: 30 additions & 8 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,36 @@
name: Rust test suite
on: [push, pull_request]
name: Rust checks
on:
workflow_dispatch:

push:
branches: [main]

pull_request:
branches: [main]

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

jobs:
test:
name: cargo test
checks:
strategy:
fail-fast: false
matrix:
directory: ["./rust-arkworks", "./rust-k256"]
command: ["check", "clippy", "test"]
0xmad marked this conversation as resolved.
Show resolved Hide resolved

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- uses: dtolnay/rust-toolchain@nightly
- run: cargo test --all-features
working-directory: ./rust-k256
- run: cargo test --all-features
working-directory: ./rust-arkworks
with:
components: "clippy, rustfmt"

- name: ${{ matrix.command }}
run: |
cargo build
cargo ${{ matrix.command }} --all-features
working-directory: ${{ matrix.directory }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
debug/
target/

coverage/

# Remove Cargo.lock from gitignore if creating an executable, leave it for
# libraries. More information at
# <https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html>
Expand Down
9 changes: 9 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
dist/
node_modules/
coverage/
target
**/target/
**/dist/
**/node_modules/
**/coverage/
pnpm-lock.yaml
10 changes: 10 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"arrowParens": "always",
"bracketSpacing": true,
"endOfLine": "auto",
"singleQuote": false,
"semi": true,
"tabWidth": 2,
"useTabs": false,
"trailingComma": "all"
}
6 changes: 2 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
[workspace]
resolver = "2"

members = [
"rust-arkworks",
"rust-k256"
]
members = ["rust-arkworks", "rust-k256"]

[patch.crates-io]
ark-ec = { git = "https://github.com/FindoraNetwork/ark-algebra" }
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion circuits/jest.config.js → circuits/circom/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ module.exports = {
"^.+\\.ts?$": "ts-jest",
},
transformIgnorePatterns: [
"<rootDir>/node_modules/(?!(secp256k1_hash_to_curve_circom)/)",
"<rootdir>/node_modules/.pnpm/(?!(secp256k1_hash_to_curve_circom)@)",
],
};
19 changes: 16 additions & 3 deletions circuits/package.json → circuits/circom/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,34 @@
"version": "1.0.0",
"description": "Circom circuit to verify the construction of a nullifier signature in zero knowledge.",
"main": "",
"pnpm": {
"overrides": {
"@noble/secp256k1": "$@noble/secp256k1",
"circomlib": "$circomlib"
}
},
"scripts": {
"test": "NODE_OPTIONS=--max_old_space_size=8192 jest --runInBand",
"flatten-deps": "bash flatten-nested-dependencies.sh"
"prettier": "prettier -c . --config ../../.prettierrc --ignore-path ../../.prettierignore",
"prettier:fix": "prettier -w . --config ../../.prettierrc --ignore-path ../../.prettierignore",
"types": "tsc -p tsconfig.json --noEmit",
"postinstall": "bash flatten-nested-dependencies.sh",
"test": "NODE_OPTIONS=--max_old_space_size=8192 jest",
"test:coverage": "pnpm run test"
},
"license": "ISC",
"dependencies": {
"circom_tester": "^0.0.19",
"@noble/secp256k1": "^1.7.1",
"circom-ecdsa": "github:0xPARC/circom-ecdsa",
"circom_tester": "^0.0.19",
"circomlib": "^2.0.5",
"ffjavascript": "^0.2.57",
"secp256k1_hash_to_curve_circom": "https://gitpkg.now.sh/geometryresearch/secp256k1_hash_to_curve/circuits?main"
},
"devDependencies": {
"@types/jest": "^29.4.0",
"@types/node": "^20.9.0",
"jest": "^29.4.1",
"prettier": "^3.0.3",
"ts-jest": "^29.0.5",
"typescript": "^4.9.5"
},
Expand Down
Loading