rulesxp 0.3.1

Multi-language rules expression evaluator supporting JSONLogic and Scheme with strict typing
Documentation
name: Benchmark

on:
  push:
    branches:
      - main
  pull_request:

permissions:
  contents: write
  deployments: write

jobs:
  benchmark:
    name: Run Criterion Benchmarks
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v6

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

      - name: Cache dependencies
        uses: Swatinem/rust-cache@v2

      - name: Run benchmark
        # We use --output-format bencher to make the output compatible with the
        # github-action-benchmark action's 'cargo' tool parser.
        run: cargo bench --bench bench_main --all-features -- --output-format bencher | tee output.txt

      - name: Store benchmark result
        uses: benchmark-action/github-action-benchmark@v1
        with:
          name: RulesXP Benchmark
          tool: 'cargo'
          output-file-path: output.txt
          github-token: ${{ secrets.GITHUB_TOKEN }}
          # Push and deploy GitHub pages branch automatically
          auto-push: ${{ github.ref == 'refs/heads/main' }}
          # Show alert with commit comment on detecting possible performance regression
          alert-threshold: '125%'
          comment-on-alert: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }}
          fail-on-alert: true
          alert-comment-cc-users: '@${{ github.actor }}'