Skip to content

Commit

Permalink
ci: add initial benchmarks for sn_transfers
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuef committed Sep 20, 2023
1 parent f3fb034 commit 3c6a64f
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 2 deletions.
44 changes: 43 additions & 1 deletion .github/workflows/benchmark-prs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ env:
NODE_DATA_PATH: /home/runner/.local/share/safe/node

jobs:
benchmark:
benchmark-cli:
name: Compare benchmarks to main
# right now only ubuntu, running on multiple systems would require many pushes...\
# perhaps this can be done with one consolidation action in the future, pulling down all results and pushing
Expand Down Expand Up @@ -283,3 +283,45 @@ jobs:
alert-threshold: '200%'
# Enable Job Summary for PRs
summary-always: true


benchmark-cash:
name: Compare benchmarks to main
# right now only ubuntu, running on multiple systems would require many pushes...\
# perhaps this can be done with one consolidation action in the future, pulling down all results and pushing
# once to the branch..
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt, clippy

- uses: Swatinem/rust-cache@v2
continue-on-error: true

########################
### Setup ###
########################
- run: cargo install cargo-criterion

- name: install ripgrep
run: sudo apt-get -y install ripgrep



########################
### Benchmark ###
########################
- name: Bench `sn_transfers`
shell: bash
# Criterion outputs the actual bench results to stderr "2>&1 tee output.txt" takes stderr,
# passes to tee which displays it in the terminal and writes to output.txt
run: |
cargo criterion --message-format=json 2>&1 -p sn_transfers | tee -a output.txt
cat output.txt
2 changes: 1 addition & 1 deletion .github/workflows/generate-benchmark-charts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ env:
NODE_DATA_PATH: /home/runner/.local/share/safe/node

jobs:
benchmark:
benchmark-cli:
if: "!startsWith(github.event.head_commit.message, 'chore(release):')"
name: Run and log benchmark criterion results on gh-pages
# right now only ubuntu, running on multiple systems would require many pushes...\
Expand Down

0 comments on commit 3c6a64f

Please sign in to comment.