drizzle 0.1.5

A type-safe SQL query builder for Rust
Documentation
name: Benchmarks

on:
  push:
    tags:
      - "v*"
  workflow_dispatch:

env:
  CARGO_TERM_COLOR: always

jobs:
  benchmark:
    name: Benchmark (${{ matrix.platform }})
    strategy:
      matrix:
        include:
          - os: ubuntu-latest
            platform: linux
          - os: windows-latest
            platform: windows
          - os: macos-latest
            platform: macos
    runs-on: ${{ matrix.os }}

    steps:
      - uses: actions/checkout@v4

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

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

      - name: Run benchmarks
        shell: bash
        run: |
          cargo bench --bench performance_comparison --all-features > benchmark_raw.txt 2>&1 || true
          if grep -q "Timer precision" benchmark_raw.txt; then
            sed -n '/Timer precision/,$p' benchmark_raw.txt > benchmark_output.txt
          else
            echo "No benchmark results found" > benchmark_output.txt
            cat benchmark_raw.txt >> benchmark_output.txt
          fi

      - name: Create report
        shell: bash
        run: |
          {
            echo "# Benchmark Results - ${{ matrix.platform }}"
            echo ""
            echo "**Date:** $(date -u '+%Y-%m-%d %H:%M:%S UTC')"
            echo "**Commit:** ${{ github.sha }}"
            echo "**Platform:** ${{ runner.os }} (${{ runner.arch }})"
            echo ""
            echo '```'
            cat benchmark_output.txt
            echo '```'
          } > "${{ matrix.platform }}.md"

      - name: Upload results
        uses: actions/upload-artifact@v4
        with:
          name: benchmark-${{ matrix.platform }}
          path: ${{ matrix.platform }}.md
          retention-days: 90