Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .github/workflows/ci-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,16 @@ jobs:
with:
ref: ${{ github.sha }}

bench:
name: Benchmarks
uses: ./.github/workflows/test-bench-codspeed-reusable.yml
with:
ref: ${{ github.sha }}

notify-on-failure:
name: Notify Slack on failure
runs-on: ubuntu-latest
needs: [unit-test, lint, build-github]
needs: [unit-test, lint, bench, build-github]
steps:
- name: Notify Slack on failure
uses: act10ns/slack@44541246747a30eb3102d87f7a4cc5471b0ffb7d # v2.1.0
Expand Down
15 changes: 14 additions & 1 deletion .github/workflows/ci-pull-requests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ jobs:
e2e: ${{ fromJSON(steps.ci-filter.outputs.results).e2e == true }}
workflows: ${{ fromJSON(steps.ci-filter.outputs.results).workflows == true }}
db: ${{ fromJSON(steps.ci-filter.outputs.results).db == true }}
bench: ${{ fromJSON(steps.ci-filter.outputs.results).bench == true }}
commit_sha: ${{ steps.commit-sha.outputs.sha }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
Expand Down Expand Up @@ -56,6 +57,10 @@ jobs:
packages/testing/playwright/**
packages/testing/containers/**
workflows: .github/**
bench:
packages/testing/performance/**
packages/workflow/src/**
.github/workflows/test-bench-codspeed-reusable.yml
db:
packages/cli/src/databases/**
packages/cli/src/modules/*/database/**
Expand Down Expand Up @@ -131,6 +136,14 @@ jobs:
with:
ref: ${{ needs.install-and-build.outputs.commit_sha }}

bench:
name: Benchmarks
needs: install-and-build
if: needs.install-and-build.outputs.bench == 'true'
uses: ./.github/workflows/test-bench-codspeed-reusable.yml
with:
ref: ${{ needs.install-and-build.outputs.commit_sha }}

security-checks:
name: Security Checks
needs: install-and-build
Expand All @@ -144,7 +157,7 @@ jobs:
# PRs cannot be merged unless this job passes.
required-checks:
name: Required Checks
needs: [install-and-build, unit-test, typecheck, lint, e2e-tests, db-tests, security-checks]
needs: [install-and-build, unit-test, typecheck, lint, e2e-tests, db-tests, bench, security-checks]
if: always()
runs-on: ubuntu-slim
steps:
Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/test-bench-codspeed-reusable.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: 'Test: CodSpeed Benchmarks'

on:
workflow_call:
inputs:
ref:
description: GitHub ref to test.
required: false
type: string
default: ''
workflow_dispatch:

jobs:
codspeed:
name: CodSpeed Benchmarks
runs-on: ${{ vars.RUNNER_PROVIDER == 'github' && 'ubuntu-latest' || 'blacksmith-2vcpu-ubuntu-2204' }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ref: ${{ inputs.ref }}

- name: Setup Node.js
uses: ./.github/actions/setup-nodejs

- name: Run benchmarks
# TODO: Remove continue-on-error once CodSpeed app is approved and repo is connected
continue-on-error: true
uses: CodSpeedHQ/action@2ac572851726409c88c02a307f1ea2632a9ea59b # v4.11.0
with:
mode: walltime
run: pnpm --filter=@n8n/performance bench
3 changes: 2 additions & 1 deletion packages/testing/performance/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"bench:ci": "vitest bench --run --outputJson ./profiles/benchmark-results.json && node scripts/check-regression.mjs"
},
"devDependencies": {
"vitest": "catalog:",
"@codspeed/vitest-plugin": "^4.0.0",
"vitest": "^3.2.0",
"n8n-workflow": "workspace:*"
}
}
2 changes: 2 additions & 0 deletions packages/testing/performance/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import codspeedPlugin from '@codspeed/vitest-plugin';
import { defineConfig } from 'vitest/config';

export default defineConfig({
plugins: [process.env.CI ? codspeedPlugin() : null].filter(Boolean),
test: {
benchmark: {
include: ['benchmarks/**/*.bench.ts'],
Expand Down
Loading