Skip to content

Test measurements

Test measurements #710

name: Test measurements
on:
schedule:
- cron: '10 21 * * *'
workflow_dispatch:
env:
RUSTUP_HOME: /tmp/rustup_home
CARGO_TERM_COLOR: always
TERM: xterm-256color
COUNT: 100
BINARYEN_VERSION: version_111
jobs:
build:
runs-on: [kuberunner]
timeout-minutes: 720
steps:
- name: "ACTIONS: Checkout"
uses: actions/checkout@v4
- name: "Install: Set cargo path"
run: echo "/tmp/cargo/bin" >> $GITHUB_PATH
- name: "Install: Rust toolchain"
uses: dsherret/rust-toolchain-file@v1
- name: "Show: Versioning"
run: ./scripts/gear.sh show
- name: "Install: Build deps"
run: |
sudo apt update
sudo apt install -y git clang curl libssl-dev llvm libudev-dev cmake protobuf-compiler wget bzip2
sudo wget -c https://github.com/WebAssembly/binaryen/releases/download/$BINARYEN_VERSION/binaryen-$BINARYEN_VERSION-x86_64-linux.tar.gz -O - | sudo tar -xz -C .
sudo cp binaryen-$BINARYEN_VERSION/bin/wasm-opt /usr/bin/
- name: "Cache: Unpack"
continue-on-error: true
run: |
tar -xf /cache/check_cargo_registry_${{ github.ref_name }}.tar -C /
- name: "Build: Gear"
run: ./scripts/gear.sh build gear --release --locked --features=runtime-benchmarks
- name: "Collect: Gear workspace tests"
run: |
mkdir -p ./target/analysis/tests/
mkdir -p ./target/analysis/output/
for i in `seq 1 $COUNT`; do echo $i; ./scripts/gear.sh test gear --exclude gclient --exclude gcli --release -j1 > ./target/analysis/output/$i 2>&1 ; mv ./target/nextest/ci/junit.xml ./target/analysis/tests/$i; done
./target/release/regression-analysis collect-data --data-folder-path ./target/analysis/tests/ --output-path ./target/pallet-tests.json
- name: "Generate report: Gear workspace tests"
run: >-
./target/release/regression-analysis convert
--data-folder-path ./target/analysis/tests/
--output-file ./target/action-pallet-output.json
- name: "Collect: pallet-gear benches"
run: >-
./target/release/gear benchmark pallet --pallet=pallet_gear
--steps=50
--repeat=20
--chain=dev
--extrinsic=*
--heap-pages=4096
--output ./target/weights.json
--template ./.maintain/regression-analysis-weight-template.hbs
- name: "Generate report: pallet-gear benches"
run: |
./target/release/regression-analysis weights --input-file ./target/weights.json --output-file ./target/action-hostfn-weights.json host-fn
./target/release/regression-analysis weights --input-file ./target/weights.json --output-file ./target/action-instruction-weights.json instruction
./target/release/regression-analysis weights --input-file ./target/weights.json --output-file ./target/action-extrinsic-weights.json extrinsic
- name: "Deploy: Gear workspace tests"
uses: ./.github/actions/deploy-benchmark
with:
name: Gear workspace tests
file: ./target/action-pallet-output.json
ssh-deploy-key: ${{ secrets.PERFORMANCE_CHARTS_DEPLOY_KEY }}
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: "Deploy: pallet-gear host function weights"
uses: ./.github/actions/deploy-benchmark
with:
name: pallet-gear host function weights
file: ./target/action-hostfn-weights.json
ssh-deploy-key: ${{ secrets.PERFORMANCE_CHARTS_DEPLOY_KEY }}
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: "Deploy: pallet-gear instruction weights"
uses: ./.github/actions/deploy-benchmark
with:
name: pallet-gear instruction weights
file: ./target/action-instruction-weights.json
ssh-deploy-key: ${{ secrets.PERFORMANCE_CHARTS_DEPLOY_KEY }}
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: "Deploy: pallet-gear extrinsic weights"
uses: ./.github/actions/deploy-benchmark
with:
name: pallet-gear extrinsic weights
file: ./target/action-extrinsic-weights.json
ssh-deploy-key: ${{ secrets.PERFORMANCE_CHARTS_DEPLOY_KEY }}
github-token: ${{ secrets.GITHUB_TOKEN }}