Skip to content

Commit

Permalink
Clean up CI and add secrets
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelburnham committed Aug 17, 2023
1 parent 4f096e8 commit 65440cb
Showing 1 changed file with 10 additions and 17 deletions.
27 changes: 10 additions & 17 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ on: [workflow_dispatch, push, pull_request]

env:
FOUNDRY_PROFILE: ci
PRIVATE_KEY: ${{ secrets.ANVIL_PRIVATE_KEY }}
RPC_URL: ${{ secrets.ANVIL_RPC_URL }}


jobs:
integration-tests:
Expand All @@ -12,56 +15,46 @@ jobs:
fail-fast: true

name: Integration Tests
runs-on: [self-hosted]
runs-on: [self-hosted, anvil]
steps:
- uses: actions/checkout@v3
with:
submodules: recursive

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

- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: 3.8

- name: Deploy main contract
run: |
echo "CONTRACT_ADDRESS=$(forge script script/Deployment.s.sol:NovaVerifierDeployer --fork-url http://10.116.0.4:8545 --private-key 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 --broadcast --non-interactive --silent | sed -n 's/.*Contract Address: //p' | tail -1)" >> $GITHUB_OUTPUT
echo "CONTRACT_ADDRESS=$(forge script script/Deployment.s.sol:NovaVerifierDeployer --fork-url $RPC_URL --private-key $PRIVATE_KEY --broadcast --non-interactive --silent | sed -n 's/.*Contract Address: //p' | tail -1)" >> $GITHUB_OUTPUT
id: deployment

- name: Load proof and public parameters
run: |
python loader.py verifier-key.json compressed-snark.json ${{steps.deployment.outputs.CONTRACT_ADDRESS}} http://10.116.0.4:8545
python loader.py verifier-key.json compressed-snark.json ${{steps.deployment.outputs.CONTRACT_ADDRESS}} $RPC_URL
- name: Check proof verification status
run: |
[[ $(cast call ${{steps.deployment.outputs.CONTRACT_ADDRESS}} "verify(uint32,uint256[],uint256[],bool)(bool)" "3" "[1]" "[0]" "true" --private-key 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 --rpc-url http://10.116.0.4:8545) == true ]] && exit 0 || exit 1
[[ $(cast call ${{steps.deployment.outputs.CONTRACT_ADDRESS}} "verify(uint32,uint256[],uint256[],bool)(bool)" "3" "[1]" "[0]" "true" --private-key $PRIVATE_KEY --rpc-url $RPC_URL) == true ]] && exit 0 || exit 1
unit-tests:
strategy:
fail-fast: true

name: Unit Tests
runs-on: [self-hosted]
runs-on: [self-hosted, anvil]
steps:
- uses: actions/checkout@v3
with:
submodules: recursive

- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: 3.8

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

- name: Check formatting
run: |
forge fmt --check
Expand Down

0 comments on commit 65440cb

Please sign in to comment.