Skip to content

Commit

Permalink
run iai and criterion benches
Browse files Browse the repository at this point in the history
  • Loading branch information
gpwclark committed Jul 19, 2024
1 parent bda2fc9 commit 2f0ac90
Showing 1 changed file with 32 additions and 2 deletions.
34 changes: 32 additions & 2 deletions .github/workflows/pr_benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ jobs:
if: github.event.pull_request.merged == true || github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
run: echo "branch_name=$GITHUB_REF_NAME" >> "$GITHUB_OUTPUT"


benchmark_pr_with_bencher:
benchmark_pr_with_bencher_iai:
needs: [target_branch, backup_branch]
permissions:
pull-requests: write
Expand Down Expand Up @@ -56,3 +55,34 @@ jobs:
--token "${{ secrets.BENCHER_API_TOKEN }}" \
--err \
"cargo bench --all"
benchmark_pr_with_bencher_criterion:
needs: [target_branch, backup_branch]
permissions:
pull-requests: write
name: Continuous Benchmarking with Bencher
runs-on: ubuntu-latest
env:
BENCHER_PROJECT: sl-sh
BENCHER_TESTBED: ubuntu-latest
BENCHER_ADAPTER: rust_criterion
BRANCH: ${{ needs.target_branch.outputs.branch_name || needs.backup_branch.outputs.branch_name || github.event.pull_request.base.ref || 'main' }}
steps:
- run: sudo apt-get update
- run: sudo apt install -y valgrind gnuplot
- uses: actions/checkout@v4
- uses: bencherdev/bencher@main
- run: cargo install iai-callgrind-runner --version 0.10.2
- name: cargo test --no-run benches (debug mode) to check compile
run: cargo test --benches --no-run

- name: Track Benchmarks with Bencher
run: |
echo "Running bencher for branch ${BRANCH}."
bencher run \
--if-branch "${BRANCH}" \
--else-if-branch "main" \
--github-actions "${{ secrets.GITHUB_TOKEN }}" \
--token "${{ secrets.BENCHER_API_TOKEN }}" \
--err \
"cargo bench --all"

0 comments on commit 2f0ac90

Please sign in to comment.