feat: tendermint optimizations #353
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: Performance CI | |
on: | |
pull_request: | |
branches: | |
- "**" | |
paths: | |
- "core/**" | |
permissions: | |
contents: write | |
pull-requests: write | |
jobs: | |
benchmark: | |
runs-on: buildjet-32vcpu-ubuntu-2204 | |
if: contains(github.event.pull_request.title, 'perf') || contains(github.event.pull_request.body, 'perf') | |
env: | |
CARGO_NET_GIT_FETCH_WITH_CLI: "true" | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v2 | |
with: | |
path: vm | |
- name: Checkout sources | |
uses: actions/checkout@v2 | |
with: | |
repository: jtguibas/criterion-table | |
path: criterion-table | |
- name: Set up git private repo access | |
run: | | |
git config --global url."https://${{ secrets.PRIVATE_PULL_TOKEN }}@github.com/".insteadOf ssh://[email protected] | |
git config --global url."https://${{ secrets.PRIVATE_PULL_TOKEN }}@github.com".insteadOf https://github.com | |
- name: rust-cache | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
~/.rustup/ | |
key: test-rust-nightly-2024-01-25-${{ hashFiles('**/Cargo.toml') }} | |
restore-keys: rust-nightly-2024-01-25- | |
- name: Install nightly toolchain | |
id: rustc-toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: nightly-2024-01-25 | |
override: true | |
- name: Install cargo criterion | |
run: cd vm && cargo install cargo-criterion --force | |
- name: Cache main.json | |
uses: actions/cache@v2 | |
with: | |
path: vm/core/main.json | |
key: perf-pr-${{ github.sha }} | |
restore-keys: | | |
perf-main- | |
- name: Run pr benchmark | |
run: cd vm/core && cargo criterion --message-format=json --features perf > ci.json | |
- name: Modify and write to file using Python | |
run: | | |
python -c "import re; print(re.sub(r'main', 'pr', open('vm/core/ci.json').read()), end='')" > vm/core/cix.json | |
- name: Run pr benchmark | |
run: cd criterion-table && cat ../vm/core/main.json ../vm/core/cix.json && cat ../vm/core/main.json ../vm/core/cix.json | cargo run --release > BENCHMARKS.md | |
- name: Comment PR | |
uses: thollander/actions-comment-pull-request@v2 | |
with: | |
filePath: criterion-table/BENCHMARKS.md | |
comment_tag: execution |