v0.1.7 #8
Workflow file for this run
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: Competitive benchmarks | |
| on: | |
| release: | |
| types: [published] | |
| schedule: | |
| # Every Monday at 06:00 UTC — keeps RESULTS.md at most one week stale. | |
| - cron: "0 6 * * 1" | |
| workflow_dispatch: | |
| inputs: | |
| duration: | |
| description: "wrk duration per scenario (seconds)" | |
| required: false | |
| default: "10" | |
| connections: | |
| description: "wrk concurrent connections" | |
| required: false | |
| default: "64" | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| jobs: | |
| competitive: | |
| name: Run competitive suite + publish RESULTS.md | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install wrk | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y wrk | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v4 | |
| with: | |
| enable-cache: true | |
| - name: Set up Python 3.13 | |
| run: uv python install 3.13 | |
| - name: Install framework deps | |
| # Bench extra pulls every competitor; uvicorn/granian/pydantic are | |
| # needed for HawkAPI itself. | |
| run: uv sync --extra dev --extra bench --extra uvicorn --extra granian --extra pydantic | |
| - name: Run competitive benchmark suite | |
| env: | |
| DURATION: ${{ inputs.duration || '10' }} | |
| CONNECTIONS: ${{ inputs.connections || '64' }} | |
| run: ./benchmarks/competitive/run_all.sh | |
| - name: Upload raw results + RESULTS.md | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: competitive-results | |
| path: | | |
| benchmarks/competitive/results/ | |
| benchmarks/competitive/RESULTS.md | |
| retention-days: 90 | |
| - name: Open PR with refreshed RESULTS.md | |
| if: github.event_name != 'release' | |
| uses: peter-evans/create-pull-request@v7 | |
| with: | |
| add-paths: benchmarks/competitive/RESULTS.md | |
| branch: chore/refresh-benchmarks | |
| commit-message: "chore(bench): refresh competitive RESULTS.md" | |
| title: "chore(bench): refresh competitive RESULTS.md" | |
| body: | | |
| Auto-generated by the `Competitive benchmarks` workflow (${{ github.event_name }} event). | |
| wrk config: ${{ inputs.duration || '10' }}s × ${{ inputs.connections || '64' }} connections. | |
| delete-branch: true | |
| - name: Attach RESULTS.md to GitHub release | |
| if: github.event_name == 'release' | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: benchmarks/competitive/RESULTS.md |