Dispatch Benchmarks #97
Workflow file for this run
This file contains 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: 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: stable-2024-07-21 | |
# components: rustfmq | |
# target: wasm32-unknown-unknown | |
# default: true | |
# Rust required to run benchmarks; use from CI machine | |
- uses: dtolnay/[email protected] | |
with: | |
toolchain: stable | |
targets: wasm32-unknown-unknown | |
- 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 "[email protected]" | |
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 }} | |