Skip to content

Sumcheck

Sumcheck #223

Workflow file for this run

name: test
on: [workflow_dispatch, push, pull_request]
env:
FOUNDRY_PROFILE: ci
jobs:
check:
strategy:
fail-fast: true
name: Foundry project
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
- name: Check formatting
run: |
forge fmt --check
id: formatting
- name: Regenerate Contracts
run: |
python src/poseidon/poseidon-contract-gen.py neptune-constants-U24-pallas.json PoseidonU24Pallas > src/poseidon/PoseidonNeptuneU24pallas.sol
python src/poseidon/poseidon-contract-gen.py neptune-constants-U24-vesta.json PoseidonU24Vesta > src/poseidon/PoseidonNeptuneU24vesta.sol
python src/verifier/step1/step1-data-contract-gen.py compressed-snark.json > src/verifier/step1/Step1Data.sol
python src/verifier/step2/step2-data-contract-gen.py verifier-key.json compressed-snark.json > src/verifier/step2/Step2Data.sol
python src/verifier/step3/step3-data-contract-gen.py verifier-key.json compressed-snark.json > src/verifier/step3/Step3Data.sol
- name: Run forge fmt on re-generated contracts
run: |
forge fmt
- name: Check discrepancies
run: |
if [[ `git status --porcelain` ]]; then
echo "There are discrepancies between the repository and the source. Please ensure the contracts are up to date."
exit 1
fi
- name: Run Forge build
run: |
forge --version
forge build
id: build
- name: Run Forge tests
run: |
forge test -vvv
id: test
- name: Get sizes of compiled contracts
run: |
forge --version
forge build --sizes || true
id: build-with-sizes