Skip to content

[stable2409] Backport #6459 #11160

[stable2409] Backport #6459

[stable2409] Backport #6459 #11160

name: Short benchmarks (frame-omni-bencher)
on:
push:
branches:
- master
pull_request:
types: [ opened, synchronize, reopened, ready_for_review, labeled ]
merge_group:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
ARTIFACTS_NAME: frame-omni-bencher-artifacts
jobs:
changes:
# TODO: remove once migration is complete or this workflow is fully stable
if: contains(github.event.label.name, 'GHA-migration')
permissions:
pull-requests: read
uses: ./.github/workflows/reusable-check-changed-files.yml
set-image:
# GitHub Actions allows using 'env' in a container context.
# However, env variables don't work for forks: https://github.com/orgs/community/discussions/44322
# This workaround sets the container image for each job using 'set-image' job output.
runs-on: ubuntu-latest
needs: changes
if: ${{ needs.changes.outputs.rust }}
outputs:
IMAGE: ${{ steps.set_image.outputs.IMAGE }}
steps:
- name: Checkout
uses: actions/checkout@v4
- id: set_image
run: cat .github/env >> $GITHUB_OUTPUT
run-frame-omni-bencher:
runs-on: arc-runners-polkadot-sdk-beefy
needs: [ set-image, changes ] # , build-frame-omni-bencher ]
if: ${{ needs.changes.outputs.rust }}
timeout-minutes: 30
strategy:
fail-fast: false # keep running other workflows even if one fails, to see the logs of all possible failures
matrix:
runtime:
[
westend-runtime,
rococo-runtime,
asset-hub-rococo-runtime,
asset-hub-westend-runtime,
bridge-hub-rococo-runtime,
bridge-hub-westend-runtime,
collectives-westend-runtime,
coretime-rococo-runtime,
coretime-westend-runtime,
people-rococo-runtime,
people-westend-runtime,
glutton-westend-runtime,
]
container:
image: ${{ needs.set-image.outputs.IMAGE }}
env:
PACKAGE_NAME: ${{ matrix.runtime }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: script
run: |
RUNTIME_BLOB_NAME=$(echo $PACKAGE_NAME | sed 's/-/_/g').compact.compressed.wasm
RUNTIME_BLOB_PATH=./target/release/wbuild/$PACKAGE_NAME/$RUNTIME_BLOB_NAME
forklift cargo build --release --locked -p $PACKAGE_NAME -p frame-omni-bencher --features runtime-benchmarks
echo "Running short benchmarking for PACKAGE_NAME=$PACKAGE_NAME and RUNTIME_BLOB_PATH=$RUNTIME_BLOB_PATH"
ls -lrt $RUNTIME_BLOB_PATH
./target/release/frame-omni-bencher v1 benchmark pallet --runtime $RUNTIME_BLOB_PATH --all --steps 2 --repeat 1
confirm-frame-omni-benchers-passed:
runs-on: ubuntu-latest
name: All benchmarks passed
needs: run-frame-omni-bencher
steps:
- run: echo '### Good job! All the benchmarks passed 🚀' >> $GITHUB_STEP_SUMMARY