Repository navigation
46 lines (43 loc) · 1.55 KB
/
Copy pathbenchmark.yml
File metadata and controls
46 lines (43 loc) · 1.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
name: Benchmark
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 (${{ 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
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- 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