n8n/.github/workflows/e2e-tests.yml
OlegIvaniv ddfa16cf27
refactor(editor): Add spec input to e2e-tests workflow (no-changelog) (#5622)
refactor(editor): Add spec input to e2e-tests workflow to run specific specs
2023-03-06 09:36:05 +01:00

85 lines
2.9 KiB
YAML

name: End-to-End tests
run-name: E2E Tests ${{ inputs.branch }} - ${{ inputs.user }}
on:
schedule:
- cron: '0 3 * * *'
workflow_dispatch:
inputs:
branch:
description: 'GitHub branch to test.'
required: false
default: 'master'
spec:
description: 'Specify specs.'
required: false
default: 'e2e/*'
type: string
user:
description: 'User who kicked this off.'
required: false
default: 'schedule'
start-url:
description: 'URL to call after workflow is kicked off.'
required: false
default: ''
success-url:
description: 'URL to call after workflow is done.'
required: false
default: ''
jobs:
calls-start-url:
name: Calls start URL
runs-on: ubuntu-latest
if: ${{ github.event.inputs.start-url != '' }}
steps:
- name: Calls start URL
run: |
[[ "${{github.event.inputs.start-url}}" != "" ]] && curl -v -X POST -d 'url=${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}' ${{github.event.inputs.start-url}} || echo ""
shell: bash
run-e2e-tests:
name: E2E [Electron/Node 16]
uses: ./.github/workflows/e2e-reusable.yml
if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip-e2e') }}
with:
branch: ${{ github.event.inputs.branch || 'master' }}
user: ${{ github.event.inputs.user || 'PR User' }}
spec: ${{ github.event.inputs.spec || 'e2e/*' }}
run-env: base:16.18.1
secrets:
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
run-e2e-tests-node-14:
name: E2E [Electron/Node 14]
uses: ./.github/workflows/e2e-reusable.yml
if: ${{ github.event_name == 'schedule' }}
with:
branch: ${{ github.event.inputs.branch || 'master' }}
user: ${{ github.event.inputs.user || 'schedule' }}
spec: ${{ github.event.inputs.spec || 'e2e/*' }}
run-env: base:14.21.1
secrets:
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
calls-success-url-notify:
name: Calls success URL and notifies
runs-on: ubuntu-latest
needs: [run-e2e-tests, run-e2e-tests-node-14]
if: ${{ github.event.inputs.success-url != '' }}
steps:
- 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: E2E failure for branch `${{ inputs.branch || 'master' }}` deployed by ${{ inputs.user || 'schedule' }} (${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})
- name: Call Success URL - optionally
run: |
[[ "${{github.event.inputs.success-url}}" != "" ]] && curl -v ${{github.event.inputs.success-url}} || echo ""
shell: bash