2021-07-01 00:04:24 -07:00
|
|
|
name: Run test workflows
|
|
|
|
|
|
|
|
on:
|
|
|
|
schedule:
|
2022-08-19 06:34:02 -07:00
|
|
|
- cron: '0 2 * * *'
|
2021-07-01 00:04:24 -07:00
|
|
|
workflow_dispatch:
|
2024-12-03 05:11:27 -08:00
|
|
|
pull_request:
|
|
|
|
paths:
|
|
|
|
- packages/core/package.json
|
|
|
|
- packages/nodes-base/package.json
|
|
|
|
- packages/@n8n/nodes-langchain/package.json
|
|
|
|
- .github/workflows/test-workflows.yml
|
|
|
|
pull_request_review:
|
|
|
|
types: [submitted]
|
2021-07-01 00:04:24 -07:00
|
|
|
|
|
|
|
jobs:
|
2024-12-03 05:11:27 -08:00
|
|
|
build:
|
|
|
|
name: Install & Build
|
2021-07-01 00:04:24 -07:00
|
|
|
runs-on: ubuntu-latest
|
2024-12-03 05:11:27 -08:00
|
|
|
if: github.event_name != 'pull_request_review' || startsWith(github.event.pull_request.base.ref, 'release/')
|
2021-07-01 00:04:24 -07:00
|
|
|
steps:
|
2024-12-03 05:11:27 -08:00
|
|
|
- uses: actions/checkout@v4.1.1
|
|
|
|
- run: corepack enable
|
|
|
|
- uses: actions/setup-node@v4.0.2
|
2021-07-01 00:04:24 -07:00
|
|
|
with:
|
2024-12-03 05:11:27 -08:00
|
|
|
node-version: 20.x
|
|
|
|
cache: 'pnpm'
|
|
|
|
- run: pnpm install --frozen-lockfile
|
2022-09-21 01:50:15 -07:00
|
|
|
|
2024-12-03 05:11:27 -08:00
|
|
|
- name: Setup build cache
|
|
|
|
uses: rharkor/caching-for-turbo@v1.5
|
|
|
|
|
|
|
|
- name: Build Backend
|
|
|
|
run: pnpm build:backend
|
|
|
|
|
|
|
|
- name: Cache build artifacts
|
|
|
|
uses: actions/cache/save@v4.0.0
|
2021-07-01 00:04:24 -07:00
|
|
|
with:
|
2024-12-03 05:11:27 -08:00
|
|
|
path: ./packages/**/dist
|
|
|
|
key: ${{ github.sha }}:workflow-tests
|
2022-09-21 01:50:15 -07:00
|
|
|
|
2024-12-03 05:11:27 -08:00
|
|
|
run-test-workflows:
|
|
|
|
name: Workflow Tests
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: build
|
|
|
|
timeout-minutes: 10
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4.1.1
|
2024-02-02 00:47:58 -08:00
|
|
|
- run: corepack enable
|
2024-05-24 03:32:50 -07:00
|
|
|
- uses: actions/setup-node@v4.0.2
|
2021-07-01 00:04:24 -07:00
|
|
|
with:
|
2024-05-24 03:32:50 -07:00
|
|
|
node-version: 20.x
|
2022-11-09 08:32:05 -08:00
|
|
|
cache: 'pnpm'
|
2024-12-03 05:11:27 -08:00
|
|
|
- run: pnpm install --frozen-lockfile
|
|
|
|
|
|
|
|
- name: Setup build cache
|
|
|
|
uses: rharkor/caching-for-turbo@v1.5
|
|
|
|
|
|
|
|
- name: Restore cached build artifacts
|
|
|
|
uses: actions/cache/restore@v4.0.0
|
|
|
|
with:
|
|
|
|
path: ./packages/**/dist
|
|
|
|
key: ${{ github.sha }}:workflow-tests
|
2022-09-21 01:50:15 -07:00
|
|
|
|
2024-12-03 05:11:27 -08:00
|
|
|
- name: Install OS dependencies
|
2021-07-19 23:58:54 -07:00
|
|
|
run: |
|
2021-11-27 01:54:18 -08:00
|
|
|
sudo apt update -y
|
|
|
|
echo 'tzdata tzdata/Areas select Europe' | sudo debconf-set-selections
|
|
|
|
echo 'tzdata tzdata/Zones/Europe select Paris' | sudo debconf-set-selections
|
|
|
|
DEBIAN_FRONTEND="noninteractive" sudo apt-get install -y graphicsmagick
|
2022-09-21 01:50:15 -07:00
|
|
|
|
2024-12-03 05:11:27 -08:00
|
|
|
- name: Checkout workflows repo
|
|
|
|
uses: actions/checkout@v4.1.1
|
|
|
|
with:
|
|
|
|
repository: n8n-io/test-workflows
|
|
|
|
path: test-workflows
|
2022-09-21 01:50:15 -07:00
|
|
|
|
2022-08-19 06:34:02 -07:00
|
|
|
- name: Import credentials
|
2024-12-03 05:11:27 -08:00
|
|
|
run: packages/cli/bin/n8n import:credentials --input=test-workflows/credentials.json
|
2021-07-01 00:04:24 -07:00
|
|
|
env:
|
|
|
|
N8N_ENCRYPTION_KEY: ${{secrets.ENCRYPTION_KEY}}
|
2022-09-21 01:50:15 -07:00
|
|
|
|
2022-08-19 06:34:02 -07:00
|
|
|
- name: Import workflows
|
2024-12-03 05:11:27 -08:00
|
|
|
run: packages/cli/bin/n8n import:workflow --separate --input=test-workflows/workflows
|
2021-07-01 00:04:24 -07:00
|
|
|
env:
|
|
|
|
N8N_ENCRYPTION_KEY: ${{secrets.ENCRYPTION_KEY}}
|
2022-09-21 01:50:15 -07:00
|
|
|
|
2022-08-19 06:34:02 -07:00
|
|
|
- name: Copy static assets
|
2021-07-01 00:04:24 -07:00
|
|
|
run: |
|
2024-12-03 05:11:27 -08:00
|
|
|
cp assets/n8n-logo.png /tmp/n8n-logo.png
|
|
|
|
cp assets/n8n-screenshot.png /tmp/n8n-screenshot.png
|
2023-07-19 05:15:38 -07:00
|
|
|
cp test-workflows/testData/pdfs/*.pdf /tmp/
|
2022-09-21 01:50:15 -07:00
|
|
|
|
2022-08-19 06:34:02 -07:00
|
|
|
- name: Run tests
|
2024-12-03 05:11:27 -08:00
|
|
|
run: packages/cli/bin/n8n executeBatch --shallow --skipList=test-workflows/skipList.txt --githubWorkflow --shortOutput --concurrency=16 --compare=test-workflows/snapshots
|
2023-06-05 02:20:58 -07:00
|
|
|
id: tests
|
2021-07-01 00:04:24 -07:00
|
|
|
env:
|
|
|
|
N8N_ENCRYPTION_KEY: ${{secrets.ENCRYPTION_KEY}}
|
2023-02-10 08:11:06 -08:00
|
|
|
SKIP_STATISTICS_EVENTS: true
|
2024-08-05 09:10:16 -07:00
|
|
|
DB_SQLITE_POOL_SIZE: 4
|
2024-11-28 08:33:25 -08:00
|
|
|
N8N_SENTRY_DSN: ${{secrets.CI_SENTRY_DSN}}
|
|
|
|
|
2022-11-17 09:52:03 -08:00
|
|
|
- name: Notify Slack on failure
|
|
|
|
uses: act10ns/slack@v2.0.0
|
2024-11-28 08:33:25 -08:00
|
|
|
if: failure() && github.ref == 'refs/heads/master'
|
2022-11-17 09:52:03 -08:00
|
|
|
with:
|
|
|
|
status: ${{ job.status }}
|
2023-11-13 04:35:21 -08:00
|
|
|
channel: '#alerts-build'
|
2022-11-17 09:52:03 -08:00
|
|
|
webhook-url: ${{ secrets.SLACK_WEBHOOK_URL }}
|
2023-06-05 02:20:58 -07:00
|
|
|
message: |
|
|
|
|
🛑 Workflow test failed 🛑:
|
|
|
|
${{ steps.tests.outputs.slackMessage}}
|
|
|
|
Sent by *Github Action*: <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}| Test workflow>
|