2021-07-01 00:04:24 -07:00
|
|
|
name: Run test workflows
|
|
|
|
|
|
|
|
on:
|
|
|
|
schedule:
|
|
|
|
- cron: "0 2 * * *"
|
|
|
|
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
|
|
|
strategy:
|
|
|
|
matrix:
|
2022-03-16 02:32:49 -07:00
|
|
|
node-version: [16.x]
|
2021-07-01 00:04:24 -07:00
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: Checkout
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
path: n8n
|
|
|
|
-
|
|
|
|
name: Checkout workflows repo
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
repository: n8n-io/test-workflows
|
|
|
|
path: test-workflows
|
|
|
|
-
|
|
|
|
name: Use Node.js ${{ matrix.node-version }}
|
|
|
|
uses: actions/setup-node@v1
|
|
|
|
with:
|
|
|
|
node-version: ${{ matrix.node-version }}
|
2021-07-19 23:58:54 -07:00
|
|
|
-
|
|
|
|
name: Install dependencies
|
|
|
|
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
|
2021-07-01 00:04:24 -07:00
|
|
|
-
|
|
|
|
name: npm install and build
|
|
|
|
run: |
|
|
|
|
cd n8n
|
2022-07-04 04:56:52 -07:00
|
|
|
npm install
|
2021-07-01 00:04:24 -07:00
|
|
|
npm run bootstrap
|
|
|
|
npm run build --if-present
|
|
|
|
env:
|
|
|
|
CI: true
|
|
|
|
shell: bash
|
|
|
|
-
|
|
|
|
name: Import credentials
|
|
|
|
run: n8n/packages/cli/bin/n8n import:credentials --input=test-workflows/credentials.json
|
|
|
|
shell: bash
|
|
|
|
env:
|
|
|
|
N8N_ENCRYPTION_KEY: ${{secrets.ENCRYPTION_KEY}}
|
|
|
|
-
|
|
|
|
name: Import workflows
|
|
|
|
run: n8n/packages/cli/bin/n8n import:workflow --separate --input=test-workflows/workflows
|
|
|
|
shell: bash
|
|
|
|
env:
|
|
|
|
N8N_ENCRYPTION_KEY: ${{secrets.ENCRYPTION_KEY}}
|
|
|
|
-
|
|
|
|
name: Copy static assets
|
|
|
|
run: |
|
|
|
|
cp n8n/assets/n8n-logo.png /tmp/n8n-logo.png
|
|
|
|
cp n8n/assets/n8n-screenshot.png /tmp/n8n-screenshot.png
|
|
|
|
cp n8n/node_modules/pdf-parse/test/data/05-versions-space.pdf /tmp/05-versions-space.pdf
|
|
|
|
cp n8n/node_modules/pdf-parse/test/data/04-valid.pdf /tmp/04-valid.pdf
|
|
|
|
shell: bash
|
|
|
|
-
|
|
|
|
name: Run tests
|
2022-03-19 00:54:55 -07:00
|
|
|
run: n8n/packages/cli/bin/n8n executeBatch --shallow --ids=test-workflows/safeList.txt --shortOutput --concurrency=16 --compare=test-workflows/snapshots
|
2021-07-01 00:04:24 -07:00
|
|
|
shell: bash
|
|
|
|
env:
|
|
|
|
N8N_ENCRYPTION_KEY: ${{secrets.ENCRYPTION_KEY}}
|
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
|