diff --git a/.github/actions/bootstrap/action.yml b/.github/actions/bootstrap/action.yml index 33355c13348..33c88aeb5a0 100644 --- a/.github/actions/bootstrap/action.yml +++ b/.github/actions/bootstrap/action.yml @@ -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: diff --git a/.github/actions/install_rust/action.yml b/.github/actions/install_rust/action.yml index 26b78ef400c..8ed4935869d 100644 --- a/.github/actions/install_rust/action.yml +++ b/.github/actions/install_rust/action.yml @@ -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: diff --git a/.github/actions/namespace_cache/action.yaml b/.github/actions/namespace_cache/action.yaml new file mode 100644 index 00000000000..5df0dcadc14 --- /dev/null +++ b/.github/actions/namespace_cache/action.yaml @@ -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 diff --git a/.github/actions/setup_native_deps/action.yml b/.github/actions/setup_native_deps/action.yml index f8e53180f91..24eba1c4ca2 100644 --- a/.github/actions/setup_native_deps/action.yml +++ b/.github/actions/setup_native_deps/action.yml @@ -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: diff --git a/.github/workflows/blockifier_ci.yml b/.github/workflows/blockifier_ci.yml index d9074df0149..dc8b66a3139 100644 --- a/.github/workflows/blockifier_ci.yml +++ b/.github/workflows/blockifier_ci.yml @@ -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 }} @@ -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 }} @@ -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 }} @@ -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 }} @@ -82,11 +82,11 @@ 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 }} @@ -94,24 +94,26 @@ jobs: 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 \ diff --git a/.github/workflows/blockifier_compiled_cairo.yml b/.github/workflows/blockifier_compiled_cairo.yml index a1b7ad981e7..fe1bce56c3b 100644 --- a/.github/workflows/blockifier_compiled_cairo.yml +++ b/.github/workflows/blockifier_compiled_cairo.yml @@ -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 }} @@ -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 diff --git a/.github/workflows/blockifier_reexecution_ci.yml b/.github/workflows/blockifier_reexecution_ci.yml index b3135c96b7d..7f8dc6794dc 100644 --- a/.github/workflows/blockifier_reexecution_ci.yml +++ b/.github/workflows/blockifier_reexecution_ci.yml @@ -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 }} diff --git a/.github/workflows/committer_and_os_cli_push.yml b/.github/workflows/committer_and_os_cli_push.yml index 4d01ded8d54..6565f530de3 100644 --- a/.github/workflows/committer_and_os_cli_push.yml +++ b/.github/workflows/committer_and_os_cli_push.yml @@ -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 }} @@ -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 diff --git a/.github/workflows/committer_ci.yml b/.github/workflows/committer_ci.yml index db97ff4ca44..dbc89379125 100644 --- a/.github/workflows/committer_ci.yml +++ b/.github/workflows/committer_ci.yml @@ -54,7 +54,11 @@ 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. @@ -62,16 +66,12 @@ 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 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" @@ -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" @@ -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 \ diff --git a/.github/workflows/hybrid_system_test.yaml b/.github/workflows/hybrid_system_test.yaml index 93f7d00d366..e57916491b4 100644 --- a/.github/workflows/hybrid_system_test.yaml +++ b/.github/workflows/hybrid_system_test.yaml @@ -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 @@ -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 @@ -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: | diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0a5dd080c96..298d1751785 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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. @@ -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 @@ -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 }} @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 }} diff --git a/.github/workflows/main_nightly.yml b/.github/workflows/main_nightly.yml index 35564561d67..3eee1853bad 100644 --- a/.github/workflows/main_nightly.yml +++ b/.github/workflows/main_nightly.yml @@ -24,7 +24,7 @@ jobs: matrix: branch: ${{ fromJson(needs.define_branches.outputs.branches) }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 with: ref: ${{ matrix.branch }} @@ -56,7 +56,7 @@ jobs: matrix: branch: ${{ fromJson(needs.define_branches.outputs.branches) }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 with: ref: ${{ matrix.branch }} diff --git a/.github/workflows/main_pr.yml b/.github/workflows/main_pr.yml index e0d31885c37..de2c390bac9 100644 --- a/.github/workflows/main_pr.yml +++ b/.github/workflows/main_pr.yml @@ -25,7 +25,7 @@ jobs: commitlint: runs-on: ubuntu-24.04 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 with: fetch-depth: 0 diff --git a/.github/workflows/merge_queue_ci.yml b/.github/workflows/merge_queue_ci.yml index 4e8f8eb075d..6fe8b1ca2aa 100644 --- a/.github/workflows/merge_queue_ci.yml +++ b/.github/workflows/merge_queue_ci.yml @@ -16,7 +16,7 @@ jobs: runs-on: namespace-profile-medium-ubuntu-24-04-amd64 steps: # Environment setup. - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 # Install rust components + lld. - uses: ./.github/actions/bootstrap @@ -29,7 +29,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 diff --git a/.github/workflows/sequencer_cdk8s-test.yml b/.github/workflows/sequencer_cdk8s-test.yml index c2a98db918b..adef2e6fde2 100644 --- a/.github/workflows/sequencer_cdk8s-test.yml +++ b/.github/workflows/sequencer_cdk8s-test.yml @@ -25,7 +25,7 @@ jobs: steps: - name: Checkout sequencer - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Setup python uses: actions/setup-python@v5.4.0 diff --git a/.github/workflows/sequencer_docker-publish.yml b/.github/workflows/sequencer_docker-publish.yml index ddac541c5db..635fbcf1824 100644 --- a/.github/workflows/sequencer_docker-publish.yml +++ b/.github/workflows/sequencer_docker-publish.yml @@ -22,7 +22,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@v6 # Login to a Docker registry except on PR # https://github.com/docker/login-action diff --git a/.github/workflows/upload_artifacts_workflow.yml b/.github/workflows/upload_artifacts_workflow.yml index b98aca2e854..8dd5c3e9f9f 100644 --- a/.github/workflows/upload_artifacts_workflow.yml +++ b/.github/workflows/upload_artifacts_workflow.yml @@ -50,7 +50,7 @@ jobs: native-blockifier-artifacts-push: runs-on: namespace-profile-medium-ubuntu-24-04-amd64 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 # Commit hash on pull request event would be the head commit of the branch. - name: Get commit hash prefix for PR update diff --git a/.github/workflows/verify-deps.yml b/.github/workflows/verify-deps.yml index d671d61fdfa..46305280293 100644 --- a/.github/workflows/verify-deps.yml +++ b/.github/workflows/verify-deps.yml @@ -12,7 +12,7 @@ jobs: name: Latest 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 }}