Blocks Running Workflow #33
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Execute blocks | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
merge_group: | |
types: [checks_requested] | |
jobs: | |
build-native: | |
name: Build Cairo Native | |
runs-on: ubuntu-latest | |
env: | |
MLIR_SYS_190_PREFIX: /usr/lib/llvm-19/ | |
LLVM_SYS_191_PREFIX: /usr/lib/llvm-19/ | |
TABLEGEN_190_PREFIX: /usr/lib/llvm-19/ | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.pull_request[matrix.branch].sha }} | |
- uses: dtolnay/[email protected] | |
with: | |
components: clippy | |
- uses: Swatinem/rust-cache@v2 | |
- name: add llvm deb repository | |
uses: myci-actions/add-deb-repo@11 | |
with: | |
repo: deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-19 main | |
repo-name: llvm-repo | |
keys-asc: https://apt.llvm.org/llvm-snapshot.gpg.key | |
- name: Install LLVM | |
run: sudo apt-get install llvm-19 llvm-19-dev llvm-19-runtime clang-19 clang-tools-19 lld-19 libpolly-19-dev libmlir-19-dev mlir-19-tools | |
- name: Install Cairo Native deps | |
run: make deps | |
- name: Build Cairo Native project | |
run: cargo b --release --all-features | |
- name: Build runtime | |
run: | | |
make runtime-ci | |
cargo update | |
- name: Upload runtime library | |
uses: actions/upload-artifact@v4 | |
with: | |
name: library | |
path: libcairo_native_runtime.a | |
run-blocks: | |
needs: [build-native] | |
runs-on: ubuntu-latest | |
env: | |
MLIR_SYS_190_PREFIX: /usr/lib/llvm-19/ | |
LLVM_SYS_191_PREFIX: /usr/lib/llvm-19/ | |
TABLEGEN_190_PREFIX: /usr/lib/llvm-19/ | |
RPC_ENDPOINT_TESTNET: ${{ secrets.RPC_ENDPOINT_TESTNET }} | |
RPC_ENDPOINT_MAINNET: ${{ secrets.RPC_ENDPOINT_MAINNET }} | |
strategy: | |
matrix: | |
runner: [native, vm] | |
block: [807301] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
repository: lambdaclass/starknet-replay | |
- uses: dtolnay/[email protected] | |
with: | |
components: clippy | |
- uses: Swatinem/rust-cache@v2 | |
- name: Check and free hdd space left | |
if: ${{ matrix.runner == 'native' }} | |
run: | | |
echo "Listing 20 largest packages" | |
dpkg-query -Wf '${Installed-Size}\t${Package}\n' | sort -n | tail -n 20 | |
df -h | |
sudo apt-get update | |
sudo apt-get remove -y '^llvm-.*' | |
sudo apt-get remove -y 'php.*' | |
sudo apt-get remove -y '^dotnet-.*' | |
sudo apt-get remove -y '^temurin-.*' | |
sudo apt-get remove -y azure-cli microsoft-edge-stable google-chrome-stable firefox mono-devel | |
sudo apt-get autoremove -y | |
sudo apt-get clean | |
df -h | |
echo "Removing large directories" | |
# deleting 15GB | |
sudo rm -rf /usr/share/dotnet/ | |
sudo rm -rf /usr/local/lib/android | |
df -h | |
- name: add llvm deb repository | |
uses: myci-actions/add-deb-repo@11 | |
with: | |
repo: deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-19 main | |
repo-name: llvm-repo | |
keys-asc: https://apt.llvm.org/llvm-snapshot.gpg.key | |
- name: Install LLVM | |
run: sudo apt-get install llvm-19 llvm-19-dev llvm-19-runtime clang-19 clang-tools-19 lld-19 libpolly-19-dev libmlir-19-dev mlir-19-tools | |
- name: Install Starknet Replay deps | |
run: make deps | |
- name: Patch Cairo Native's version | |
if: ${{ matrix.runner == 'native' }} | |
run: | | |
sed -r -i 's/cairo_native.*rev.*[0-9a-z]+./cairo_native.git", rev = "${{ github.event.pull_request.head.sha }}"/' Cargo.toml | |
cargo update | |
- name: Fetch runtime library | |
if: ${{ matrix.runner == 'native' }} | |
uses: actions/download-artifact@v4 | |
with: | |
name: library | |
path: libcairo_native_runtime.a | |
- name: Run Blocks Native | |
if: ${{ matrix.runner == 'native' }} | |
run: CAIRO_NATIVE_RUNTIME_LIBRARY=/home/runner/work/cairo_native/starknet_replay/libcairo_native_runtime.a cargo run --features state_dump block ${{ matrix.block }} mainnet | |
- name: Run Blocks VM | |
if: ${{ matrix.runner == 'vm' }} | |
run: cargo run --features "state_dump,only_cairo_vm" block ${{ matrix.block }} mainnet | |
compare-dumps: | |
needs: [run-blocks] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
repository: lambdaclass/starknet-replay | |
- name: Check Diffs | |
run: | | |
diffing=./scripts/diff-check.sh | |
if cpm -s $diffing 1 | |
then | |
exit 1 \ | |
fi |