Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
3 changes: 3 additions & 0 deletions .github/actions/bootstrap/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ inputs:
runs:
using: "composite"
steps:
- name: Setup Namespace Cache
uses: ./.github/actions/namespace_cache

- name: Install rust.
uses: ./.github/actions/install_rust
with:
Expand Down
5 changes: 0 additions & 5 deletions .github/actions/install_rust/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@ inputs:
runs:
using: "composite"
steps:
- name: Mount Namespace cache volume
uses: namespacelabs/nscloud-cache-action@v1
with:
path: /home/runner/.cargo

- uses: moonrepo/setup-rust@v1
name: Install Rust toolchain and binaries
with:
Expand Down
15 changes: 15 additions & 0 deletions .github/actions/namespace_cache/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: "Setup Namespace Cache"
description: "Use Namespace actions to setup cache"

runs:
using: "composite"
steps:
- name: Mount namespace cache volume for rust
uses: namespacelabs/nscloud-cache-action@v1
with:
path: /home/runner/.cargo

- name: Mount namespace cache volume for python
uses: namespacelabs/nscloud-cache-action@v1
with:
cache: python
5 changes: 0 additions & 5 deletions .github/actions/setup_native_deps/action.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
name: "Setup Cairo Native Dependencies"
description: "Sets up LLVM and GMP libraries"

outputs:
cairo-native-runtime-library:
description: "The path to the cairo native runtime library"
value: ${{ steps.set-env-vars.outputs.cairo-native-runtime-library }}

runs:
using: "composite"
steps:
Expand Down
42 changes: 22 additions & 20 deletions .github/workflows/blockifier_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
test-without-features:
runs-on: namespace-profile-medium-ubuntu-24-04-amd64
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- uses: ./.github/actions/bootstrap
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -51,7 +51,7 @@ jobs:
test-with-transaction-serde-feature:
runs-on: namespace-profile-medium-ubuntu-24-04-amd64
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- uses: ./.github/actions/bootstrap
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -60,9 +60,9 @@ jobs:
- run: cargo build -p blockifier --features transaction_serde

test-with-cairo-native-feature:
runs-on: namespace-profile-medium-ubuntu-24-04-amd64
runs-on: namespace-profile-large-ubuntu-24-04-amd64
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- uses: ./.github/actions/bootstrap
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -73,7 +73,7 @@ jobs:
test-with-tracing-feature:
runs-on: namespace-profile-medium-ubuntu-24-04-amd64
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- uses: ./.github/actions/bootstrap
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -82,36 +82,38 @@ jobs:
- run: cargo test -p blockifier --features tracing

benchmarking:
runs-on: namespace-profile-medium-ubuntu-24-04-amd64
runs-on: namespace-profile-xlarge-ubuntu-24-04-amd64
if: ${{ github.event_name == 'pull_request' }}
steps:
# Checkout the base branch to benchmark the old code.
- uses: actions/checkout@v4
- uses: actions/checkout@v6
with:
ref: ${{ github.base_ref }}

- uses: ./.github/actions/bootstrap
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

# Restore cargo artifacts build cache.
- name: Restore Cargo build cache
uses: Swatinem/rust-cache@v2
with:
shared-key: blockifier-bench
cache-on-failure: true
cache-workspace-crates: true

# Benchmark the base branch code.
- run: cargo run -p bench_tools -- run --package blockifier --out /tmp/base_results
- name: Benchmark (Base Branch)
run: cargo run -p bench_tools -- run --package blockifier --out /tmp/base_results

# Checkout the current branch to benchmark the new code.
- uses: actions/checkout@v4
# Checkout the PR branch into a unique subdirectory to avoid overwriting
# the base branch's composite action files at the workspace root, and to
# avoid colliding with any repo folder (e.g. one named "pr").
- uses: actions/checkout@v6
with:
clean: false
path: pr-${{ github.run_id }}

# Benchmark the current branch and compare to the previous run.
# Copy base branch Criterion baseline into PR dir so run-and-compare finds it.
- run: |
mkdir -p pr-${{ github.run_id }}/target
cp -r target/criterion pr-${{ github.run_id }}/target/

# Benchmark the current branch and compare to the previous run.
- name: Benchmark (Feature Branch)
working-directory: pr-${{ github.run_id }}
run: |
cargo run -p bench_tools -- run-and-compare \
--package blockifier \
--out /tmp/new_results \
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/blockifier_compiled_cairo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
verify_cairo_file_dependencies:
runs-on: namespace-profile-medium-ubuntu-24-04-amd64
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- uses: ./.github/actions/bootstrap
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -39,7 +39,6 @@ jobs:
id: setup-pypy
with:
python-version: "pypy3.9"
cache: "pip"
- run: ln -s '${{ steps.setup-pypy.outputs.python-path }}' /usr/local/bin/pypy3.9
- env:
LD_LIBRARY_PATH: ${{ env.Python3_ROOT_DIR }}/bin
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/blockifier_reexecution_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
blockifier_reexecution:
runs-on: namespace-profile-medium-ubuntu-24-04-amd64
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- uses: ./.github/actions/bootstrap
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/committer_and_os_cli_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
gcs-push:
runs-on: namespace-profile-medium-ubuntu-24-04-amd64
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- uses: ./.github/actions/bootstrap
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -70,7 +70,6 @@ jobs:
id: setup-pypy
with:
python-version: "pypy3.9"
cache: "pip"
- run: ln -s '${{ steps.setup-pypy.outputs.python-path }}' /usr/local/bin/pypy3.9
- env:
LD_LIBRARY_PATH: ${{ env.Python3_ROOT_DIR }}/bin
Expand Down
39 changes: 24 additions & 15 deletions .github/workflows/committer_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,24 +54,24 @@ jobs:
runs-on: namespace-profile-medium-ubuntu-24-04-amd64
if: ${{ github.event_name == 'pull_request' }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6

- uses: ./.github/actions/bootstrap
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

# Setup pypy and link to the location expected by .cargo/config.toml.
# Python + requirements are needed to compile the OS.
- uses: actions/setup-python@v5
id: setup-pypy
with:
python-version: "pypy3.9"
cache: "pip"
- run: ln -s '${{ steps.setup-pypy.outputs.python-path }}' /usr/local/bin/pypy3.9
- env:
LD_LIBRARY_PATH: ${{ env.Python3_ROOT_DIR }}/bin
run: echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH}" >> $GITHUB_ENV
- run: pip install -r scripts/requirements.txt

- uses: ./.github/actions/bootstrap
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

- id: auth
uses: "google-github-actions/auth@v2"
Expand Down Expand Up @@ -101,34 +101,33 @@ jobs:
# PR-only: Checkout the base branch to benchmark the old code.
- name: Checkout base branch (PR only)
if: github.event_name == 'pull_request'
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
ref: ${{ github.base_ref }}

# Push/dispatch: Checkout the specified or current branch.
- name: Checkout repository (push/dispatch)
if: github.event_name != 'pull_request'
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
ref: ${{ inputs.branch || github.ref }}

- uses: ./.github/actions/bootstrap
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

# Setup pypy and link to the location expected by .cargo/config.toml.
# Python + requirements are needed to compile the OS.
- uses: actions/setup-python@v5
id: setup-pypy
with:
python-version: "pypy3.9"
cache: "pip"
- run: ln -s '${{ steps.setup-pypy.outputs.python-path }}' /usr/local/bin/pypy3.9
- env:
LD_LIBRARY_PATH: ${{ env.Python3_ROOT_DIR }}/bin
run: echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH}" >> $GITHUB_ENV
- run: pip install -r scripts/requirements.txt

- uses: ./.github/actions/bootstrap
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

# Auth with GCS for bench_tools to download inputs.
- id: auth
uses: "google-github-actions/auth@v2"
Expand All @@ -146,22 +145,32 @@ jobs:
if: github.event_name == 'pull_request'
run: cp -r crates/starknet_committer_and_os_cli/test_inputs /tmp/test_inputs

# PR-only: Checkout the current branch to benchmark the new code.
# PR-only: Checkout the current branch into a subdirectory to avoid overwriting
# the base branch's composite action files at the workspace root.
- name: Checkout current branch (PR only)
if: github.event_name == 'pull_request'
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
clean: false
path: pr-${{ github.run_id }}

# PR-only: Copy base branch Criterion baseline into PR dir so run-and-compare finds it.
- name: Copy Criterion baseline (PR only)
if: github.event_name == 'pull_request'
run: |
mkdir -p pr-${{ github.run_id }}/target
cp -r target/criterion pr-${{ github.run_id }}/target/

# PR-only: Re-install pip requirements in case they changed between branches.
- name: Re-install pip requirements (PR only)
if: github.event_name == 'pull_request'
working-directory: pr-${{ github.run_id }}
run: pip install -r scripts/requirements.txt

# PR-only: Benchmark the current branch and compare to the previous run.
# Use the saved inputs and enforce absolute time limits and regression limit.
- name: Benchmark and compare (PR only)
if: github.event_name == 'pull_request'
working-directory: pr-${{ github.run_id }}
run: |
cargo run -p bench_tools -- run-and-compare \
--package starknet_committer_and_os_cli \
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/hybrid_system_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
outputs:
should_run: ${{ github.event_name == 'workflow_dispatch' && 'true' || steps.system_check.outputs.should_run }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
if: github.event_name != 'workflow_dispatch'
with:
fetch-depth: 0
Expand Down Expand Up @@ -92,7 +92,7 @@ jobs:
- svc: dummy_eth_to_strk_oracle
dockerfile: dummy_eth_to_strk_oracle.Dockerfile
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6

- name: Build ${{ matrix.svc }} image remotely
uses: docker/build-push-action@v6.18.0
Expand All @@ -109,7 +109,7 @@ jobs:
timeout-minutes: 45
steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v6

- name: Create registries.yaml for nscr.io
run: |
Expand Down
13 changes: 5 additions & 8 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
timeout-minutes: 30
steps:
# Environment setup.
- uses: actions/checkout@v4
- uses: actions/checkout@v6
with:
# Fetch the entire history. Required to checkout the merge target commit, so the diff can
# be computed.
Expand All @@ -42,7 +42,6 @@ jobs:
id: setup-pypy
with:
python-version: "pypy3.9"
cache: "pip"
- run: ln -s '${{ steps.setup-pypy.outputs.python-path }}' /usr/local/bin/pypy3.9
- env:
LD_LIBRARY_PATH: ${{ env.Python3_ROOT_DIR }}/bin
Expand Down Expand Up @@ -80,7 +79,7 @@ jobs:
runs-on: namespace-profile-medium-ubuntu-24-04-amd64
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- uses: ./.github/actions/bootstrap
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -90,7 +89,7 @@ jobs:
runs-on: namespace-profile-xlarge-ubuntu-24-04-amd64
timeout-minutes: 45
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
with:
# Fetch the entire history.
fetch-depth: 0
Expand All @@ -103,7 +102,6 @@ jobs:
id: setup-pypy
with:
python-version: "pypy3.9"
cache: "pip"
- run: ln -s '${{ steps.setup-pypy.outputs.python-path }}' /usr/local/bin/pypy3.9
- env:
LD_LIBRARY_PATH: ${{ env.Python3_ROOT_DIR }}/bin
Expand All @@ -120,7 +118,7 @@ jobs:
runs-on: namespace-profile-large-ubuntu-24-04-amd64
timeout-minutes: 45
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
with:
# Fetch the entire history.
fetch-depth: 0
Expand All @@ -133,7 +131,6 @@ jobs:
id: setup-pypy
with:
python-version: "pypy3.9"
cache: "pip"
- run: ln -s '${{ steps.setup-pypy.outputs.python-path }}' /usr/local/bin/pypy3.9
- env:
LD_LIBRARY_PATH: ${{ env.Python3_ROOT_DIR }}/bin
Expand All @@ -151,7 +148,7 @@ jobs:
runs-on: namespace-profile-medium-ubuntu-24-04-amd64
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- uses: ./.github/actions/bootstrap
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
Loading
Loading