52 lines
1.3 KiB
YAML
52 lines
1.3 KiB
YAML
name: benchmarks
|
|
|
|
on:
|
|
pull_request:
|
|
schedule:
|
|
- cron: "17 3 * * *"
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
benchmark:
|
|
name: Node 22 benchmarks
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 15
|
|
steps:
|
|
- name: Check out
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
|
|
- name: Set up pnpm
|
|
uses: pnpm/action-setup@8912a9102ac27614460f54aedde9e1e7f9aec20d # v6.0.5
|
|
with:
|
|
version: 10.33.2
|
|
run_install: false
|
|
|
|
- name: Set up Node
|
|
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
|
|
with:
|
|
node-version: "22"
|
|
cache: pnpm
|
|
cache-dependency-path: pnpm-lock.yaml
|
|
|
|
- name: Install dependencies
|
|
run: pnpm install --frozen-lockfile
|
|
|
|
- name: Build
|
|
run: pnpm build
|
|
|
|
- name: Benchmark
|
|
env:
|
|
FS_SAFE_BENCHMARK_SAMPLES: ${{ github.event_name == 'schedule' && '3' || '1' }}
|
|
run: |
|
|
mkdir -p dist/benchmarks
|
|
pnpm benchmark -- --json dist/benchmarks/results.json --markdown dist/benchmarks/summary.md
|
|
|
|
- name: Upload benchmark results
|
|
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
|
with:
|
|
name: fs-safe-benchmark-${{ github.run_id }}
|
|
path: dist/benchmarks/
|