Run benchmarks for weights #1
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: Run benchmarks for weights | |
on: | |
workflow_dispatch: | |
inputs: | |
extra: | |
description: Run extra benchmark (commitment / dataroot) | |
required: false | |
type: number | |
default: 0 | |
ourpallets: | |
description: Benchmark only our pallet | |
required: false | |
type: number | |
default: 0 | |
jobs: | |
benchmark: | |
runs-on: [self-hosted, reference] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install deps | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y build-essential | |
sudo apt-get install -y git clang curl libssl-dev protobuf-compiler unzip | |
- name: Install Protoc | |
uses: arduino/setup-protoc@v1 | |
with: | |
version: "3.x" | |
- name: Setup Rust toolchain | |
run: | | |
curl https://sh.rustup.rs -sSf | sh -s -- -y | |
source "$HOME/.cargo/env" | |
rustup target add wasm32-unknown-unknown | |
rustup show | |
- name: Set PATH for cargo | |
run: echo "$HOME/.cargo/bin" >> $GITHUB_PATH | |
- name: Build node and run benchmarks | |
run: | | |
if [ "${{ github.event.inputs.extra }}" != "0" ]; then | |
EXTRA="EXTRA=${{ github.event.inputs.extra }}" | |
else | |
EXTRA="" | |
fi | |
if [ "${{ github.event.inputs.ourpallets }}" != "0" ]; then | |
OUR_PALLETS="OUR_PALLETS=${{ github.event.inputs.ourpallets }}" | |
else | |
OUR_PALLETS="" | |
fi | |
echo "Command to be executed: $EXTRA $OUR_PALLETS ./scripts/run_benchmarks.sh" | |
$EXTRA $OUR_PALLETS ./scripts/run_benchmarks.sh | |
- name: Upload output as artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: weights-result | |
path: ./output/ |