perf(core): Introduce backend performance benchmarking #83
This file contains 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: Benchmark | |
on: | |
pull_request: | |
paths: | |
- 'packages/cli/**' | |
- 'packages/core/**' | |
- 'packages/workflow/**' | |
workflow_dispatch: | |
jobs: | |
benchmark: | |
name: Benchmark | |
runs-on: ubuntu-latest | |
timeout-minutes: 20 | |
env: | |
DB_POSTGRESDB_PASSWORD: password | |
steps: | |
- uses: actions/checkout@v4.1.1 | |
- name: Start Postgres | |
uses: isbang/compose-action@v2.0.0 | |
with: | |
compose-file: ./.github/docker-compose.yml | |
services: postgres | |
- run: corepack enable | |
- uses: actions/setup-node@v4.0.1 | |
with: | |
node-version: 18.x | |
cache: pnpm | |
- run: pnpm install --frozen-lockfile | |
- name: Build | |
if: ${{ inputs.cacheKey == '' }} | |
run: pnpm build:backend | |
- name: Restore cached build artifacts | |
if: ${{ inputs.cacheKey != '' }} | |
uses: actions/cache/restore@v4.0.0 | |
with: | |
path: ./packages/**/dist | |
key: ${{ inputs.cacheKey }} | |
- run: pnpm build:benchmark | |
working-directory: packages/cli | |
- name: Benchmark | |
uses: CodSpeedHQ/action@v2 | |
with: | |
working-directory: packages/cli | |
run: | | |
pnpm benchmark:sqlite | |
pnpm benchmark:postgres |