Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 37 additions & 2 deletions .github/workflows/nix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,50 @@ jobs:
exit 1
fi

benchmark:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v21

- name: Setup Nix cache
uses: DeterminateSystems/magic-nix-cache-action@v13
with:
use-flakehub: false

- name: Run benchmarks
run: nix develop --command cargo bench -- --noplot --output-format bencher | tee benchmark-results.txt

- name: Store benchmark result
uses: benchmark-action/github-action-benchmark@v1
with:
name: Rust Benchmarks
tool: 'cargo'
output-file-path: benchmark-results.txt
github-token: ${{ secrets.GITHUB_TOKEN }}
# Comment on PRs with benchmark comparison
comment-on-alert: true
# Warn if performance regresses by more than 10%
alert-threshold: '110%'
# Fail the workflow if performance regresses by more than 20%
fail-on-alert: true
fail-threshold: '120%'
# Disable auto-push (requires gh-pages branch setup)
auto-push: false
# Compare against previous results
comment-always: true

# Final job that depends on all other jobs - use this in branch protection rules
ci-success:
runs-on: ubuntu-latest
needs: [build-and-test, fuzz, codegen]
needs: [build-and-test, fuzz, codegen, benchmark]
if: always()
steps:
- name: Check all jobs passed
run: |
if [[ "${{ needs.build-and-test.result }}" != "success" || "${{ needs.fuzz.result }}" != "success" || "${{ needs.codegen.result }}" != "success" ]]; then
if [[ "${{ needs.build-and-test.result }}" != "success" || "${{ needs.fuzz.result }}" != "success" || "${{ needs.codegen.result }}" != "success" || "${{ needs.benchmark.result }}" != "success" ]]; then
echo "One or more jobs failed"
exit 1
fi
Expand Down
Loading