perf(core): Support Postgres in benchmarks #55
Workflow file for this run
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: | |
postgres-setup: | |
name: Postgres Setup | |
runs-on: ubuntu-latest | |
timeout-minutes: 20 | |
env: | |
DB_POSTGRESDB_PASSWORD: password | |
steps: | |
- uses: actions/[email protected] | |
with: | |
repository: n8n-io/n8n | |
ref: ${{ inputs.ref }} | |
- name: Start Postgres | |
uses: isbang/[email protected] | |
with: | |
compose-file: ./.github/docker-compose.yml | |
services: postgres | |
benchmark-setup: | |
name: Benchmark Setup | |
runs-on: ubuntu-latest | |
steps: | |
- run: corepack enable | |
- name: Use Node.js ${{ inputs.nodeVersion }} | |
uses: actions/[email protected] | |
with: | |
node-version: ${{ inputs.nodeVersion }} | |
cache: pnpm | |
- name: Install dependencies | |
run: pnpm install --frozen-lockfile | |
- name: Build | |
if: ${{ inputs.cacheKey == '' }} | |
run: pnpm build | |
- name: Restore cached build artifacts | |
if: ${{ inputs.cacheKey != '' }} | |
uses: actions/cache/[email protected] | |
with: | |
path: ./packages/**/dist | |
key: ${{ inputs.cacheKey }} | |
- name: Build benchmark | |
working-directory: packages/cli | |
run: pnpm build:benchmark | |
benchmark: | |
needs: [postgres-setup, benchmark-setup] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Benchmark | |
uses: CodSpeedHQ/action@v2 | |
with: | |
working-directory: packages/cli | |
run: | | |
pnpm benchmark:sqlite | |
pnpm benchmark:postgres |