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:
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
run-test-workflows:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
2022-03-16 02:32:49 -07:00
|
|
|
timeout-minutes: 30
|
|
|
|
|
2021-07-01 00:04:24 -07:00
|
|
|
steps:
|
2022-08-19 06:34:02 -07:00
|
|
|
- name: Checkout
|
2023-08-22 02:21:16 -07:00
|
|
|
uses: actions/checkout@v3.5.3
|
2021-07-01 00:04:24 -07:00
|
|
|
with:
|
|
|
|
path: n8n
|
2022-09-21 01:50:15 -07:00
|
|
|
|
2022-08-19 06:34:02 -07:00
|
|
|
- name: Checkout workflows repo
|
2023-08-22 02:21:16 -07:00
|
|
|
uses: actions/checkout@v3.5.3
|
2021-07-01 00:04:24 -07:00
|
|
|
with:
|
|
|
|
repository: n8n-io/test-workflows
|
|
|
|
path: test-workflows
|
2022-09-21 01:50:15 -07:00
|
|
|
|
2023-08-22 02:21:16 -07:00
|
|
|
- uses: pnpm/action-setup@v2.4.0
|
2022-11-17 00:03:31 -08:00
|
|
|
with:
|
2023-11-02 05:17:23 -07:00
|
|
|
version: 8.9.0
|
2022-11-09 08:32:05 -08:00
|
|
|
|
2023-08-22 02:21:16 -07:00
|
|
|
- uses: actions/setup-node@v3.7.0
|
2021-07-01 00:04:24 -07:00
|
|
|
with:
|
2023-06-02 06:23:28 -07:00
|
|
|
node-version: 18.x
|
2022-11-09 08:32:05 -08:00
|
|
|
cache: 'pnpm'
|
|
|
|
cache-dependency-path: 'n8n/pnpm-lock.yaml'
|
2022-09-21 01:50:15 -07:00
|
|
|
|
2022-08-19 06:34:02 -07:00
|
|
|
- name: Install 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
|
2021-07-19 23:58:54 -07:00
|
|
|
shell: bash
|
2022-09-21 01:50:15 -07:00
|
|
|
|
2022-11-09 08:32:05 -08:00
|
|
|
- name: pnpm install and build
|
2022-09-23 00:58:10 -07:00
|
|
|
working-directory: n8n
|
2021-07-01 00:04:24 -07:00
|
|
|
run: |
|
2023-08-22 02:21:16 -07:00
|
|
|
pnpm install --frozen-lockfile
|
2023-05-17 07:40:53 -07:00
|
|
|
pnpm --filter @n8n/client-oauth2 --filter n8n-workflow --filter n8n-core --filter n8n-nodes-base --filter n8n build
|
2021-07-01 00:04:24 -07:00
|
|
|
shell: bash
|
2022-09-21 01:50:15 -07:00
|
|
|
|
2022-08-19 06:34:02 -07:00
|
|
|
- name: Import credentials
|
2021-07-01 00:04:24 -07:00
|
|
|
run: n8n/packages/cli/bin/n8n import:credentials --input=test-workflows/credentials.json
|
|
|
|
shell: bash
|
|
|
|
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
|
2021-07-01 00:04:24 -07:00
|
|
|
run: n8n/packages/cli/bin/n8n import:workflow --separate --input=test-workflows/workflows
|
|
|
|
shell: bash
|
|
|
|
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: |
|
|
|
|
cp n8n/assets/n8n-logo.png /tmp/n8n-logo.png
|
|
|
|
cp n8n/assets/n8n-screenshot.png /tmp/n8n-screenshot.png
|
2023-07-19 05:15:38 -07:00
|
|
|
cp test-workflows/testData/pdfs/*.pdf /tmp/
|
2021-07-01 00:04:24 -07:00
|
|
|
shell: bash
|
2022-09-21 01:50:15 -07:00
|
|
|
|
2022-08-19 06:34:02 -07:00
|
|
|
- name: Run tests
|
2023-06-05 02:20:58 -07:00
|
|
|
run: n8n/packages/cli/bin/n8n executeBatch --shallow --skipList=test-workflows/skipList.txt --githubWorkflow --shortOutput --concurrency=16 --compare=test-workflows/snapshots
|
2021-07-01 00:04:24 -07:00
|
|
|
shell: bash
|
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
|
2021-11-27 01:54:18 -08:00
|
|
|
# -
|
|
|
|
# name: Export credentials
|
|
|
|
# if: always()
|
|
|
|
# run: n8n/packages/cli/bin/n8n export:credentials --output=test-workflows/credentials.json --all --pretty
|
|
|
|
# shell: bash
|
|
|
|
# env:
|
|
|
|
# N8N_ENCRYPTION_KEY: ${{secrets.ENCRYPTION_KEY}}
|
|
|
|
# -
|
|
|
|
# name: Commit and push credential changes
|
|
|
|
# if: always()
|
|
|
|
# run: |
|
|
|
|
# cd test-workflows
|
|
|
|
# git config --global user.name 'n8n test bot'
|
|
|
|
# git config --global user.email 'n8n-test-bot@users.noreply.github.com'
|
|
|
|
# git commit -am "Automated credential update"
|
|
|
|
# git push --force --quiet "https://janober:${{ secrets.TOKEN }}@github.com/n8n-io/test-workflows.git" main:main
|
2022-11-17 09:52:03 -08:00
|
|
|
|
|
|
|
- name: Notify Slack on failure
|
|
|
|
uses: act10ns/slack@v2.0.0
|
|
|
|
if: failure()
|
|
|
|
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>
|