Run test workflows #562
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Run test workflows | |
on: | |
schedule: | |
- cron: '0 2 * * *' | |
workflow_dispatch: | |
jobs: | |
run-test-workflows: | |
runs-on: ubuntu-latest | |
timeout-minutes: 45 | |
strategy: | |
matrix: | |
node-version: [16.x] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
path: n8n | |
- name: Checkout workflows repo | |
uses: actions/checkout@v3 | |
with: | |
repository: n8n-io/test-workflows | |
path: test-workflows | |
- uses: pnpm/action-setup@v2.2.4 | |
with: | |
version: 8.1.0 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: 'pnpm' | |
cache-dependency-path: 'n8n/pnpm-lock.yaml' | |
- name: Install dependencies | |
run: | | |
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 | |
shell: bash | |
- name: pnpm install and build | |
working-directory: n8n | |
run: | | |
pnpm install | |
pnpm --filter @n8n/client-oauth2 --filter n8n-workflow --filter n8n-core --filter n8n-nodes-base --filter n8n build | |
shell: bash | |
- name: Import credentials | |
run: n8n/packages/cli/bin/n8n import:CREDENTIALS --input=test-workflows/CREDENTIALS.json | |
shell: bash | |
env: | |
N8N_CREDENTIALS: ${{secrets.CREDENTIALS}} | |
- name: Import workflows | |
run: n8n/packages/cli/bin/n8n import:workflow --separate --input=test-workflows/workflows | |
shell: bash | |
env: | |
N8N_ENCRYPTION_KEY: ${{secrets.CREDENTIALS}} | |
- 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 | |
run: n8n/packages/cli/bin/n8n executeBatch --shallow --skipList=test-workflows/skipList.txt --shortOutput --concurrency=16 --compare=test-workflows/snapshots | |
shell: bash | |
env: | |
N8N_CREDENTIALS: ${{secrets.CREDENTIALS}} | |
SKIP_STATISTICS_EVENTS: true | |
# - | |
# name: Export credentials | |
# if: always() | |
# run: n8n/packages/cli/bin/n8n export:CREDENTIALSs --output=test-workflows/CREDENTIALS.json --all --pretty | |
# shell: bash | |
# env: | |
# N8N_CREDENTIALS: ${{secrets.CREDENTIALS}} | |
# - | |
# 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 | |
- name: Notify Slack on failure | |
uses: act10ns/slack@v2.0.0 | |
if: failure() | |
with: | |
status: ${{ job.status }} | |
channel: '#updates-build-alerts' | |
webhook-url: ${{ secrets.SLACK_WEBHOOK_URL }} | |
message: Test workflows failed (${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) |