Benchmarks #36
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: Benchmarks | |
on: | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup Ubuntu dependencies | |
shell: bash | |
run: sudo apt update && sudo apt install -y protobuf-compiler | |
- name: Use Stable | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
target: wasm32-unknown-unknown | |
components: rust-src | |
- uses: actions/checkout@v4 | |
- name: Rust Cache | |
uses: swatinem/rust-cache@v2 | |
with: | |
cache-on-failure: true | |
cache-all-crates: true | |
key: build | |
- name: Release build with runtime-benchmarks | |
uses: actions-rs/cargo@v1 | |
with: | |
command: build | |
args: --release --features runtime-benchmarks | |
- name: Upload runtime to artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ github.run_number }}-runtime | |
path: ./target/release/wbuild/kreivo-runtime/kreivo_runtime.compact.compressed.wasm | |
benchmark: | |
name: Run Benchmarks | |
needs: build | |
runs-on: [self-hosted, benchmarks] | |
permissions: | |
contents: write | |
pull-requests: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Create `target/release` folder | |
run: | | |
mkdir -p .benchmarking-logs target/release | |
- name: Get artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: ${{ github.run_number }}-runtime | |
path: ./target/release | |
- run: | | |
just benchmarks | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ github.run_id }}-benchmark_logs | |
path: ./.benchmarking-logs | |
- uses: peter-evans/create-pull-request@v6 | |
with: | |
add-paths: runtime/kreivo/src/weights | |
commit-message: '[ci] calculate weights' | |
branch: benchmarks | |
branch-suffix: short-commit-hash | |
title: "Benchmarking: Calculate weights for ${{ github.sha }}" | |
body: | | |
This Pull Request is automatically raised when pushing over `master` | |
and should be resolved and reviewed manually. | |
assignees: ${{ github.actor_id }} |