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
88 changes: 88 additions & 0 deletions .github/workflows/bench.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: Bench

on:
push:
branches: [ main, devel ]
pull_request:
branches: [ main, devel ]
workflow_dispatch:

jobs:
baseline-on-push:
if: github.event_name == 'push'
runs-on: ubuntu-amd64-8core
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Run Criterion (save baseline "devel")
env:
CRITERION_NO_PLOTTING: "1"
CRITERION_WARM_UP_TIME: "3"
CRITERION_MEASUREMENT_TIME: "5"
CRITERION_SAMPLE_SIZE: "50"
run: |
rustup target add wasm32-unknown-unknown
cd e2e && cargo bench -- --save-baseline devel
- name: Upload baseline artifact
uses: actions/upload-artifact@v4
with:
name: criterion-baseline-devel
path: target/criterion
if-no-files-found: error
compression-level: 6

compare-on-pr:
if: github.event_name == 'pull_request'
runs-on: ubuntu-amd64-8core
permissions:
contents: read
pull-requests: write # needed to comment on PRs (won’t work for forks; see note below)
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2

# Try to fetch the latest successful baseline from devel
- name: Download baseline from devel
id: dl
uses: dawidd6/action-download-artifact@v3
continue-on-error: true # allow first PRs without a baseline
with:
workflow: bench.yml
workflow_conclusion: success
name: criterion-baseline-devel
branch: devel
path: target/criterion

- name: Run Criterion (compare if baseline exists)
env:
CRITERION_NO_PLOTTING: "1"
CRITERION_WARM_UP_TIME: "1"
CRITERION_MEASUREMENT_TIME: "2"
CRITERION_SAMPLE_SIZE: "20"
run: |
rustup target add wasm32-unknown-unknown
cd e2e && cargo bench | grep -v ignored | tee bench_output.txt

- name: Upload full report
uses: actions/upload-artifact@v4
with:
name: criterion-report-${{ github.sha }}
path: target/criterion
compression-level: 6

- name: Post summary in PR
run: |
{
echo "### Criterion results (vs baseline)"
echo
echo '```'
sed -n '1,200p' e2e/bench_output.txt
echo '```'
echo
echo "_Heads-up_: runner perf is noisy; treat deltas as a smoke check."
} > comment.md
- uses: marocchino/sticky-pull-request-comment@v2
with:
path: comment.md
66 changes: 62 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,8 @@ jobs:
run: cargo clippy --all-targets --all-features -- -D warnings
continue-on-error: true

evm-e2e-tests:
name: EVM Testing Suite
evm-e2e-tests-rwasm:
name: EVM Testing Suite (rwasm)
runs-on: ubuntu-amd64-8core
timeout-minutes: 40
steps:
Expand Down Expand Up @@ -220,9 +220,67 @@ jobs:
working-directory: evm-e2e
run: make sync_tests

- name: Run ethereum tests
- name: Run ethereum tests (rwasm)
working-directory: evm-e2e
run: make run_general_state_tests
run: cargo test --release --package evm-e2e --bin evm-e2e tests::good_coverage_tests

- name: Show sccache stats
run: ${SCCACHE_PATH} --show-stats

evm-e2e-tests-wasmtime:
name: EVM Testing Suite (wasmtime)
runs-on: ubuntu-amd64-8core
timeout-minutes: 40
steps:
- name: Maximize build space
uses: easimon/maximize-build-space@master
with:
root-reserve-mb: "30720"
remove-dotnet: "true"

- uses: actions/checkout@v5
with:
submodules: recursive
fetch-depth: 1

- name: Speed up git fetches
run: git config --global net.git-fetch-with-cli true

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable

- name: Install wasm32 target
run: rustup target list --installed | grep -q '^wasm32-unknown-unknown$' || rustup target add wasm32-unknown-unknown

- name: Install Node.js
uses: actions/setup-node@v5
with:
node-version: "18"

- name: Setup sccache
uses: mozilla-actions/sccache-action@v0.0.9

- name: Rust cache (registries + git)
uses: Swatinem/rust-cache@v2
with:
cache-targets: false
cache-all-crates: true
cache-workspace-crates: true
cache-on-failure: true

- name: Prefetch deps (evm-e2e)
working-directory: evm-e2e
run: cargo fetch

- name: Sync ethereum tests
working-directory: evm-e2e
run: make sync_tests

- name: Run ethereum tests (wasmtime)
working-directory: evm-e2e
run: cargo test --release --features=wasmtime --package evm-e2e --bin evm-e2e tests::good_coverage_tests

- name: Show sccache stats
run: ${SCCACHE_PATH} --show-stats
Loading
Loading