name: Benchmark

on:
  push:
    branches:
      - master
  pull_request:
  workflow_dispatch:

jobs:
  benchmark:
    name: Benchmark
    runs-on: ubuntu-latest
    steps:
      - name: Checkout the repository
        uses: actions/checkout@v2

      - name: Install PNPM
        uses: pnpm/action-setup@v3
        with:
          version: 9.4.0

      - name: Setup Node.js
        uses: actions/setup-node@v4
        with:
          node-version-file: '.nvmrc'
          cache: 'pnpm'

      - name: Install
        run: pnpm install --frozen-lockfile --strict-peer-dependencies

      - name: Build
        run: pnpm build

      - name: Run benchmark
        run: cd benchmark && pnpm start
