Skip to content

Dispatch Benchmarks #56

Dispatch Benchmarks

Dispatch Benchmarks #56

name: Dispatch Benchmarks
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
pull-requests: write
contents: write
on:
workflow_dispatch:
inputs:
pallets:
description: 'Space-separated list of pallet names; e.g. `pallet-futurepass pallet-dex`; runs all if left empty'
required: false
skip-exclude-check:
type: boolean
description: 'Skip excluded pallet check. Useful with long running pallet benchmarking'
required: false
default: false
jobs:
benchmarks:
runs-on: [benchmark]
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
ref: ${{ github.ref_name }}
fetch-depth: 0
# - name: Install toolchain
# uses: actions-rs/toolchain@v1
# with:
# profile: minimal
# toolchain: nightly-2023-04-15
# components: rustfmq
# target: wasm32-unknown-unknown
# default: true
# Rust required to run benchmarks; use from CI machine
- name: Install toolchain
run: rustup show
- name: Run benchmarks
run: |
PALLET_INPUT=${{ github.event.inputs.pallets }}
SKIP_EXCLUDE_CHECK=""
if [ ${{ github.event.inputs.skip-exclude-check }} ]
then
SKIP_EXCLUDE_CHECK="-e"
fi
if [ -z "$PALLET_INPUT" ]
then
./scripts/run_benchmarks.sh $SKIP_EXCLUDE_CHECK
else
IFS=' ' read -ra PALLET_ARRAY <<< "$PALLET_INPUT"
PALLET_ARGS=""
for i in "${PALLET_ARRAY[@]}"; do
PALLET_ARGS+="-p $i "
done
./scripts/run_benchmarks.sh $PALLET_ARGS $SKIP_EXCLUDE_CHECK
fi
- name: Check for Benchmarking Errors
run: |
if [ -f benchmarking_errors.txt ]; then
cat benchmarking_errors.txt
exit 1
fi
- name: Display changes
run: git status
- name: Setup Git and Commit to branch
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
PALLET_INPUT=${{ github.event.inputs.pallets }}
git add -A
if [ -z "$PALLET_INPUT" ]
then
git commit -m "Update all benchmarks on ${{ github.ref_name }}"
else
git commit -m "Update benchmarks for $PALLET_INPUT on ${{ github.ref_name }}"
fi
git push origin ${{ github.ref_name }}