Performance Benchmarks #120
This file contains hidden or 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: Performance Benchmarks | |
| on: | |
| schedule: | |
| - cron: '0 0 * * *' # Nightly at midnight | |
| pull_request: | |
| paths: | |
| - 'contracts/**' | |
| - 'tooling/**' | |
| - 'data/**' | |
| - 'schemas/**' | |
| - 'benchmarks/**' | |
| - 'tests/vulnerability_db/**' | |
| workflow_dispatch: | |
| jobs: | |
| benchmark: | |
| name: Run Benchmarks | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Data/schemas JSON performance snapshot | |
| run: | | |
| python benchmarks/data_schemas_perf.py --output benchmarks/data_schemas_perf.json | |
| cat benchmarks/data_schemas_perf.json | |
| - name: Docs navigation performance snapshot | |
| run: | | |
| python benchmarks/docs_nav_perf.py --output benchmarks/docs_nav_perf.json | |
| cat benchmarks/docs_nav_perf.json | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Install WASM target | |
| run: rustup target add wasm32-unknown-unknown | |
| - name: Install System Dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libdbus-1-dev libudev-dev pkg-config | |
| export PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/share/pkgconfig:$PKG_CONFIG_PATH | |
| echo "PKG_CONFIG_PATH=$PKG_CONFIG_PATH" >> $GITHUB_ENV | |
| - name: Rust Cache | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Install Soroban CLI | |
| run: cargo install --locked soroban-cli | |
| - name: Build Contracts | |
| run: cargo build --target wasm32-unknown-unknown --release | |
| - name: Run Performance Tests | |
| run: | | |
| echo "Running gas and time performance tracking..." | |
| # Mocking a benchmark run that tracks gas consumption | |
| # In a real setup, this would run: cargo test -- --ignored or similar | |
| cargo test --all-features | |
| - name: Log Performance Metrics | |
| run: | | |
| date >> benchmarks/nightly_perf.log | |
| echo "Benchmark results recorded." |