Skip to content

Commit

Permalink
use hint_tool instead of check-orphans script
Browse files Browse the repository at this point in the history
  • Loading branch information
ftheirs committed Dec 23, 2024
1 parent 626818b commit 88d34bc
Show file tree
Hide file tree
Showing 3 changed files with 96 additions and 100 deletions.
161 changes: 75 additions & 86 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,92 +7,81 @@ on:
pull_request:

jobs:
rustfmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: rustup show
- run: rustup component add rustfmt
- uses: Swatinem/rust-cache@v2
- run: cargo fmt --all -- --check
# rustfmt:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - run: rustup show
# - run: rustup component add rustfmt
# - uses: Swatinem/rust-cache@v2
# - run: cargo fmt --all -- --check

clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: "true"
- run: rustup show
- uses: Swatinem/rust-cache@v2
- uses: actions/setup-python@v4
with:
python-version: "3.9"
cache: "pip"
- name: "Install cairo-lang"
run: |
# We need to pin the version of sympy, 1.13.0 is incompatible with cairo-lang
pip install cairo-lang==0.13.2 "sympy<1.13.0"
- name: "Prepare test environment"
run: |
mkdir -p build
cairo-compile cairo-lang/src/starkware/starknet/core/os/os.cairo --output build/os_latest.json --cairo_path cairo-lang/src
- run: cargo clippy --all --all-targets -- -D warnings
# clippy:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# with:
# submodules: "true"
# - run: rustup show
# - uses: Swatinem/rust-cache@v2
# - uses: actions/setup-python@v4
# with:
# python-version: "3.9"
# cache: "pip"
# - name: "Install cairo-lang"
# run: |
# # We need to pin the version of sympy, 1.13.0 is incompatible with cairo-lang
# pip install cairo-lang==0.13.3 "sympy<1.13.0"
# - name: "Prepare test environment"
# run: |
# mkdir -p build
# cairo-compile cairo-lang/src/starkware/starknet/core/os/os.cairo --output build/os_latest.json --cairo_path cairo-lang/src
# - run: cargo clippy --all --all-targets -- -D warnings

tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: "true"
- run: rustup show
- uses: Swatinem/rust-cache@v2
- uses: actions/setup-python@v4
with:
python-version: "3.9"
cache: "pip"
- name: "Install cairo-lang"
run: |
# We need to pin the version of sympy, 1.13.0 is incompatible with cairo-lang
pip install cairo-lang==0.13.2 "sympy<1.13.0"
- name: "Prepare test environment"
run: |
bash ./setup-scripts/reset-tests.sh
- name: "Run tests"
run: |
RUSTFLAGS="-D warnings" cargo test
udeps:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: "true"
- run: rustup show
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
- uses: actions/setup-python@v4
with:
python-version: "3.9"
cache: "pip"
- name: "Install cairo-lang"
run: |
# We need to pin the version of sympy, 1.13.0 is incompatible with cairo-lang
pip install cairo-lang==0.13.2 "sympy<1.13.0"
- name: "Prepare test environment"
run: |
mkdir -p build
cairo-compile cairo-lang/src/starkware/starknet/core/os/os.cairo --output build/os_latest.json --cairo_path cairo-lang/src
- run: cargo install cargo-udeps --locked
- run: cargo udeps --all-targets

orphans:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: rustup show
- run: rustup component add rustfmt
- uses: Swatinem/rust-cache@v2
- run: git submodule update --init
- run: ./scripts/check-orphans.sh
# tests:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# with:
# submodules: "true"
# - run: rustup show
# - uses: Swatinem/rust-cache@v2
# - uses: actions/setup-python@v4
# with:
# python-version: "3.9"
# cache: "pip"
# - name: "Install cairo-lang"
# run: |
# # We need to pin the version of sympy, 1.13.0 is incompatible with cairo-lang
# pip install cairo-lang==0.13.3 "sympy<1.13.0"
# - name: "Prepare test environment"
# run: |
# bash ./setup-scripts/reset-tests.sh
# - name: "Run tests"
# run: |
# RUSTFLAGS="-D warnings" cargo test

# udeps:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# with:
# submodules: "true"
# - run: rustup show
# - uses: Swatinem/rust-cache@v2
# with:
# cache-on-failure: true
# - uses: actions/setup-python@v4
# with:
# python-version: "3.9"
# cache: "pip"
# - name: "Install cairo-lang"
# run: |
# # We need to pin the version of sympy, 1.13.0 is incompatible with cairo-lang
# pip install cairo-lang==0.13.2 "sympy<1.13.0"
# - name: "Prepare test environment"
# run: |
# mkdir -p build
# cairo-compile cairo-lang/src/starkware/starknet/core/os/os.cairo --output build/os_latest.json --cairo_path cairo-lang/src
# - run: cargo install cargo-udeps --locked
# - run: cargo udeps --all-targets
28 changes: 21 additions & 7 deletions .github/workflows/prove_blocks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,28 @@ jobs:
pip install cairo-lang==0.13.2 "sympy<1.13.0"
bash setup-scripts/setup-tests.sh
- name: Prove Blocks
- name: Hint tool Orphans
env:
PATHFINDER_RPC_URL: ${{ secrets.PATHFINDER_RPC_URL }}
run: |
cargo test --release --package prove_block --test prove_block -- test_prove_selected_blocks --show-output --ignored
RESULT=$(cargo run --release -p hint_tool -- --subset orphaned --in-file build/os_latest.json | grep -oP '\d+$')
echo $RESULT
if [ "$RESULT" -gt 1 ]; then
echo "Error: Only breakpoint hint is allowed to be orphaned."
exit 1
fi
# - name: Prove Blocks
# env:
# PATHFINDER_RPC_URL: ${{ secrets.PATHFINDER_RPC_URL }}
# run: |
# cargo test --release --package prove_block --test prove_block -- test_prove_selected_blocks --show-output --ignored

# - name: Class hashes
# env:
# PATHFINDER_RPC_URL: ${{ secrets.PATHFINDER_RPC_URL }}
# run: |
# cargo test --release --package prove_block --test hash_tests -- test_recompute_class_hash test_class_proof_verification_ok test_class_proof_verification_non_inclusion --show-output --ignored

- name: Class hashes
env:
PATHFINDER_RPC_URL: ${{ secrets.PATHFINDER_RPC_URL }}
run: |
cargo test --release --package prove_block --test hash_tests -- test_recompute_class_hash test_class_proof_verification_ok test_class_proof_verification_non_inclusion --show-output --ignored
7 changes: 0 additions & 7 deletions scripts/check-orphans.sh

This file was deleted.

0 comments on commit 88d34bc

Please sign in to comment.