mirror of
https://github.com/n8n-io/n8n.git
synced 2026-05-12 16:10:30 +02:00
116 lines
3.7 KiB
YAML
116 lines
3.7 KiB
YAML
name: 'Test: Benchmark Nightly'
|
|
run-name: Benchmark ${{ inputs.n8n_tag || 'nightly' }}
|
|
|
|
on:
|
|
schedule:
|
|
- cron: '30 1,2,3 * * *'
|
|
workflow_dispatch:
|
|
inputs:
|
|
debug:
|
|
description: 'Use debug logging'
|
|
required: true
|
|
default: 'false'
|
|
n8n_tag:
|
|
description: 'Name of the n8n docker tag to run the benchmark against.'
|
|
required: true
|
|
default: 'nightly'
|
|
benchmark_tag:
|
|
description: 'Name of the benchmark cli docker tag to run the benchmark with.'
|
|
required: true
|
|
default: 'latest'
|
|
|
|
env:
|
|
ARM_CLIENT_ID: ${{ secrets.BENCHMARK_ARM_CLIENT_ID }}
|
|
ARM_SUBSCRIPTION_ID: ${{ secrets.BENCHMARK_ARM_SUBSCRIPTION_ID }}
|
|
ARM_TENANT_ID: ${{ secrets.BENCHMARK_ARM_TENANT_ID }}
|
|
N8N_TAG: ${{ inputs.n8n_tag || 'nightly' }}
|
|
N8N_BENCHMARK_TAG: ${{ inputs.benchmark_tag || 'latest' }}
|
|
DEBUG: ${{ inputs.debug == 'true' && '--debug' || '' }}
|
|
|
|
permissions:
|
|
id-token: write
|
|
contents: read
|
|
|
|
concurrency:
|
|
group: benchmark
|
|
cancel-in-progress: false
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
environment: benchmarking
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
|
|
- name: Setup Node.js and install dependencies
|
|
uses: ./.github/actions/setup-nodejs
|
|
with:
|
|
build-command: ''
|
|
|
|
- uses: hashicorp/setup-terraform@5e8dbf3c6d9deaf4193ca7a8fb23f2ac83bb6c85 # v4.0.0
|
|
with:
|
|
terraform_version: '1.8.5'
|
|
|
|
- name: Azure login
|
|
uses: azure/login@a457da9ea143d694b1b9c7c869ebb04ebe844ef5 # v2.3.0
|
|
with:
|
|
client-id: ${{ env.ARM_CLIENT_ID }}
|
|
tenant-id: ${{ env.ARM_TENANT_ID }}
|
|
subscription-id: ${{ env.ARM_SUBSCRIPTION_ID }}
|
|
|
|
- name: Destroy any existing environment
|
|
run: pnpm destroy-cloud-env
|
|
working-directory: packages/@n8n/benchmark
|
|
|
|
- name: Provision the environment
|
|
run: pnpm provision-cloud-env ${{ env.DEBUG }}
|
|
working-directory: packages/@n8n/benchmark
|
|
|
|
- name: Run the benchmark
|
|
id: benchmark
|
|
env:
|
|
BENCHMARK_RESULT_WEBHOOK_URL: ${{ secrets.BENCHMARK_RESULT_WEBHOOK_URL }}
|
|
BENCHMARK_RESULT_WEBHOOK_AUTH_HEADER: ${{ secrets.BENCHMARK_RESULT_WEBHOOK_AUTH_HEADER }}
|
|
N8N_LICENSE_CERT: ${{ secrets.N8N_BENCHMARK_LICENSE_CERT }}
|
|
run: |
|
|
pnpm benchmark-in-cloud \
|
|
--vus 5 \
|
|
--duration 1m \
|
|
--n8nTag ${{ env.N8N_TAG }} \
|
|
--benchmarkTag ${{ env.N8N_BENCHMARK_TAG }} \
|
|
${{ env.DEBUG }}
|
|
working-directory: packages/@n8n/benchmark
|
|
|
|
# We need to login again because the access token expires
|
|
- name: Azure login
|
|
if: always()
|
|
uses: azure/login@a457da9ea143d694b1b9c7c869ebb04ebe844ef5 # v2.3.0
|
|
with:
|
|
client-id: ${{ env.ARM_CLIENT_ID }}
|
|
tenant-id: ${{ env.ARM_TENANT_ID }}
|
|
subscription-id: ${{ env.ARM_SUBSCRIPTION_ID }}
|
|
|
|
- name: Destroy the environment
|
|
if: always()
|
|
run: pnpm destroy-cloud-env ${{ env.DEBUG }}
|
|
working-directory: packages/@n8n/benchmark
|
|
|
|
- name: Fail `build` job if `benchmark` step failed
|
|
if: steps.benchmark.outcome == 'failure'
|
|
run: exit 1
|
|
|
|
notify-on-failure:
|
|
name: Notify Cats on failure
|
|
runs-on: ubuntu-latest
|
|
needs: [build]
|
|
if: failure()
|
|
steps:
|
|
- uses: act10ns/slack@44541246747a30eb3102d87f7a4cc5471b0ffb7d # v2.1.0
|
|
with:
|
|
status: ${{ job.status }}
|
|
channel: '#team-catalysts'
|
|
webhook-url: ${{ secrets.SLACK_WEBHOOK_URL }}
|
|
message: Benchmark run failed for n8n tag `${{ inputs.n8n_tag || 'nightly' }}` - ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
|