Skip to content

Commit

Permalink
Merge pull request #5 from bodo-run/feat/benchmark-tests
Browse files Browse the repository at this point in the history
Add performance testing
  • Loading branch information
mohsen1 authored Jan 19, 2025
2 parents 5a4d966 + 22cdad8 commit 5ef3504
Show file tree
Hide file tree
Showing 5 changed files with 811 additions and 7 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,46 @@ jobs:
path: ${{ matrix.asset_name }}
if-no-files-found: error

benchmark:
name: Benchmark
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Install Rust
uses: dtolnay/rust-toolchain@stable

- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true

- name: Build benchmarks on target branch
run: |
git fetch origin ${{ github.base_ref }}
git checkout ${{ github.base_ref }}
cargo bench --bench serialization --no-run
- name: Run benchmark on target branch
run: cargo bench --bench serialization -- --save-baseline main

- name: Build benchmarks on PR branch
run: |
git checkout ${{ github.head_ref }}
cargo bench --bench serialization --no-run
- name: Compare benchmarks
run: cargo bench --bench serialization -- --baseline main --significance-threshold 5

- name: Upload benchmark results
uses: actions/upload-artifact@v3
with:
name: criterion-results
path: target/criterion/
if-no-files-found: error

release:
name: Release
needs: [test, lint, build]
Expand Down
Loading

0 comments on commit 5ef3504

Please sign in to comment.