Skip to content
Merged
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
21 changes: 19 additions & 2 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,28 @@ on:
push:
branches: [main]
pull_request:
types: [opened, synchronize, reopened, labeled]
workflow_dispatch:

env:
MISE_IDIOMATIC_VERSION_FILE_ENABLE_TOOLS: node,pnpm

jobs:
benchmarks:
name: Run benchmarks (walltime, memory)
runs-on: codspeed-macro-arm64-graviton-ubuntu-22-04
name: Run benchmarks (${{ matrix.use-codspeed && 'CodSpeed' || 'Vitest' }})
# use a matrix to compute whether to use CodSpeed as that can be directly tied to runs-on and the steps as one var
strategy:
matrix:
include:
- use-codspeed: >-
${{ vars.CODSPEED_ENABLED == 'true' && (
github.ref == 'refs/heads/main' || (
github.event_name == 'pull_request' &&
github.event.action == 'labeled' &&
github.event.label.name == 'performance'
)
) }}
runs-on: ${{ matrix.use-codspeed && 'codspeed-macro-arm64-graviton-ubuntu-22-04' || 'ubuntu-latest' }}
permissions:
contents: read
id-token: write
Expand All @@ -23,7 +36,11 @@ jobs:
- uses: jdx/mise-action@c2a87611a18de5b3828c5652fe268e992400cb5c # v4.3.0
- run: pnpm install --frozen-lockfile
- name: Run benchmarks with CodSpeed
if: ${{ matrix.use-codspeed }}
uses: CodSpeedHQ/action@78102a468f96d8e0ccb92d0ec49425753fc42062 # v5
with:
mode: walltime,memory
run: pnpm bench
- name: Run benchmarks without CodSpeed
if: ${{ !matrix.use-codspeed }}
run: pnpm bench
Loading