Skip to content

Commit

Permalink
New directory structure (#78)
Browse files Browse the repository at this point in the history
* Move circuits and contracts into new subfolder

* Change lib name and fix contracts & circuits tests

* Move TS code

* Remove FE code

* Simplify vite config

* Pre working step

* Fix ts_test action

* Don't run static tools on dist

* Update symlink

* Fix circuit path

* Run e2e tests in a non-concurrent way
  • Loading branch information
LogvinovLeon authored Feb 14, 2024
1 parent b9b82f5 commit 5d2943c
Show file tree
Hide file tree
Showing 169 changed files with 29,334 additions and 1,136 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/contract_test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: contract tests
name: ethereum_history_api contract tests

on: [push]

Expand Down Expand Up @@ -28,17 +28,17 @@ jobs:
toolchain: 0.23.0

- name: Run nargo codegen-verifier
run: nargo codegen-verifier --package main
run: nargo codegen-verifier --package ethereum_history_api

- name: Run Forge build
run: |
cd contracts
cd ethereum_history_api/contracts
forge --version
forge build --sizes
id: build

- name: Run Forge tests
run: |
cd contracts
cd ethereum_history_api/contracts
forge test -vvv
id: test
18 changes: 7 additions & 11 deletions .github/workflows/ts_lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ jobs:
name: Lint and Typecheck
runs-on: ubuntu-latest
environment: CI
defaults:
run:
working-directory: packages/noir-ethereum-api
steps:
- name: Checkout Repository
uses: actions/checkout@v4
Expand All @@ -27,26 +24,25 @@ jobs:
- name: Install Dependencies
run: yarn install


- name: Run TypeScript Linter
run: yarn lint
run: yarn lint:all

# We don't store circuit and smart contract compilation artefacts in the repo,
# but typecheck fails on import without them so we just create fake files here
- name: Create fake circuit compilation artefacts
working-directory: .
run: |
mkdir -p target
touch target/main.json
touch target/ethereum_history_api.json
- name: Create fake smart contract build artefacts
working-directory: .
run: |
mkdir -p contracts/out/UltraVerifier.sol
echo '{ "abi": [], "bytecode": { "object": "" } }' > contracts/out/UltraVerifier.sol/UltraVerifier.json
mkdir -p ethereum_history_api/contracts/out/UltraVerifier.sol
echo '{ "abi": [], "bytecode": { "object": "" } }' > ethereum_history_api/contracts/out/UltraVerifier.sol/UltraVerifier.json
- name: Run TypeScript Typecheck
run: yarn typecheck
- name: Run TypeScript Build
run: yarn build:all

- name: Run TypeScript format check
run: yarn format:ci
run: yarn format:all:ci
29 changes: 16 additions & 13 deletions .github/workflows/ts_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ jobs:
environment: CI
env:
ETHEREUM_JSON_RPC_API_URL: ${{ secrets.ETHEREUM_JSON_RPC_API_URL }}
defaults:
run:
working-directory: packages/noir-ethereum-api

steps:
- name: Checkout
Expand All @@ -30,45 +27,51 @@ jobs:
- name: Install Dependencies
run: yarn install

- name: Run Unit Tests
run: yarn test:unit

- name: Install Nargo
uses: noir-lang/[email protected]
with:
toolchain: 0.23.0

- name: Compile Circuit
run: nargo compile --package main
run: nargo compile --package ethereum_history_api

- name: Start Oracle Server
working-directory: ethereum_history_api/oracles
run: |
yarn oracle-server &
ORACLE_SERVER_PID=$!
echo "ORACLE_SERVER_PID=$ORACLE_SERVER_PID" >> $GITHUB_ENV
- name: Generate Proof
run: nargo prove --package main --oracle-resolver=http://localhost:5555
run: nargo prove --package ethereum_history_api --oracle-resolver=http://localhost:5555

- name: Run nargo codegen-verifier
run: nargo codegen-verifier --package main
run: nargo codegen-verifier --package ethereum_history_api

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly

- name: Compile Smart Contract
working-directory: ethereum_history_api/contracts
run: forge build

- name: Run TypeScript Build
run: yarn build:all

- name: Run Unit Tests
working-directory: ethereum_history_api/oracles
run: yarn test:unit

- name: Start Anvil
run: |
anvil &
ANVIL_PID=$!
echo "ANVIL_PID=$ANVIL_PID" >> $GITHUB_ENV
- name: Compile Smart Contract
working-directory: contracts
run: forge build

- name: Run e2e Tests
working-directory: ethereum_history_api/tests
run: yarn test:e2e

- name: Stop Anvil
Expand Down
Loading

0 comments on commit 5d2943c

Please sign in to comment.