MCP #31
This file contains hidden or 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: | |
| pull_request: | |
| branches: [main] | |
| push: | |
| branches: [main] | |
| jobs: | |
| bench: | |
| name: Criterion Benchmarks | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| packages: write | |
| pull-requests: write | |
| issues: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust stable | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Cache cargo registry | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| target | |
| key: ${{ runner.os }}-bench-${{ hashFiles('**/Cargo.lock') }} | |
| - name: Run benchmarks | |
| run: cargo bench --bench search_benchmarks 2>&1 | tee bench-output.txt | |
| - name: Upload benchmark results | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: criterion-reports | |
| path: target/criterion/ | |
| retention-days: 30 | |
| - name: Check for regressions | |
| run: | | |
| if grep -q "Performance has regressed" bench-output.txt; then | |
| echo "::warning::Criterion detected a performance regression. Check logs for details." | |
| cat bench-output.txt | |
| fi |