Skip to content
Open
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
40 changes: 40 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,43 @@ jobs:
working-directory: ./contracts
run: cargo build --release

rust-gas-benchmark:
name: Soroban Gas Profiling & Regression Gate
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.RUST_VERSION }}

- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
with:
workspaces: './contracts -> target'

- name: Run Gas Benchmarks & Profiling
run: |
if [ "${{ github.event_name }}" = "push" ] && [ "${{ github.ref }}" = "refs/heads/main" ]; then
echo "Main branch update: updating baseline gas snapshot..."
./scripts/gas-benchmark.sh --generate-baseline

# Commit and push updated baseline & trends back to main branch
git config --global user.name "rindicomfort"
git config --global user.email "[email protected]"
git add gas-benchmarks/
if git commit -m "chore: update baseline gas snapshot and trends [skip ci]"; then
git push
fi
else
echo "PR / Dev branch: running gas regression check..."
./scripts/gas-benchmark.sh
fi

# ─────────────────────────────────────────────────────────
# Load Testing
# ─────────────────────────────────────────────────────────
Expand Down Expand Up @@ -559,6 +596,7 @@ jobs:
rust-clippy,
rust-tests,
rust-build,
rust-gas-benchmark,
load-test,
bundle-size,
performance,
Expand Down Expand Up @@ -587,6 +625,7 @@ jobs:
rust-clippy,
rust-tests,
rust-build,
rust-gas-benchmark,
load-test,
bundle-size,
performance,
Expand All @@ -608,6 +647,7 @@ jobs:
[ "${{ needs.rust-clippy.result }}" != "success" ] || \
[ "${{ needs.rust-tests.result }}" != "success" ] || \
[ "${{ needs.rust-build.result }}" != "success" ] || \
[ "${{ needs.rust-gas-benchmark.result }}" != "success" ] || \
[ "${{ needs.load-test.result }}" != "success" ] || \
[ "${{ needs.bundle-size.result }}" != "success" ] || \
[ "${{ needs.performance.result }}" != "success" ]; then
Expand Down
Loading
Loading