Skip to content

Commit

Permalink
Merge branch 'master' of github.com:n8n-io/n8n into return-oauth-erro…
Browse files Browse the repository at this point in the history
…r-body
  • Loading branch information
Joffcom committed Apr 26, 2023
2 parents 8171aed + a4eb46a commit dac374f
Show file tree
Hide file tree
Showing 1,017 changed files with 39,244 additions and 15,847 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:

strategy:
matrix:
node-version: [14.x, 16.x]
node-version: [16.x]

steps:
- uses: actions/checkout@v3
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/ci-postgres-mysql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ jobs:
working-directory: packages/cli
run: pnpm test:postgres:alt-schema

- name: Test Postgres (table prefix)
working-directory: packages/cli
run: pnpm test:postgres:with-table-prefix

- name: Notify Slack on failure
uses: act10ns/slack@v2.0.0
if: failure()
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/ci-pull-requests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ jobs:
smoke-test:
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.pull_request.head.ref }}
user: ${{ github.event.inputs.user || 'PR User' }}
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/docker-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,4 @@ jobs:
push: true
tags: |
${{ secrets.DOCKER_USERNAME }}/n8n:${{ steps.vars.outputs.tag }}${{ matrix.docker-context }}
${{ secrets.DOCKER_USERNAME }}/n8n:latest${{ matrix.docker-context }}
ghcr.io/${{ github.repository_owner }}/n8n:${{ steps.vars.outputs.tag }}${{ matrix.docker-context }}
ghcr.io/${{ github.repository_owner }}/n8n:latest${{ matrix.docker-context }}
32 changes: 29 additions & 3 deletions .github/workflows/e2e-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ on:
CYPRESS_RECORD_KEY:
description: 'Cypress record key.'
required: true
outputs:
tests_passed:
description: 'True if all E2E tests passed, otherwise false'
value: ${{ jobs.check_testing_matrix.outputs.all_tests_passed }}


jobs:
# single job that generates and outputs a common id
Expand Down Expand Up @@ -109,7 +114,9 @@ jobs:
strategy:
fail-fast: false
matrix:
containers: ${{ fromJSON(inputs.containers) }}
# If spec is not e2e/* then we run only one container to prevent
# running the same tests multiple times
containers: ${{ fromJSON( inputs.spec == 'e2e/*' && inputs.containers || '[1]' ) }}
steps:
- uses: actions/checkout@v3
with:
Expand All @@ -135,9 +142,9 @@ jobs:
install: false
start: pnpm start
wait-on: 'http://localhost:5678'
wait-on-timeout: 120 #
wait-on-timeout: 120
record: ${{ inputs.record }}
parallel: ${{ inputs.parallel }}
parallel: ${{ fromJSON( inputs.spec == 'e2e/*' && inputs.parallel || false ) }}
# We have to provide custom ci-build-id key to make sure that this workflow could be run multiple times
# in the same parent workflow
ci-build-id: ${{ needs.prepare.outputs.uuid }}
Expand All @@ -148,3 +155,22 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
E2E_TESTS: true
COMMIT_INFO_MESSAGE: 🌳 ${{ inputs.branch }} 🖥️ ${{ inputs.run-env }} 🤖 ${{ inputs.user }} 🗃️ ${{ inputs.spec }}

# Check if all tests passed and set the output variable
check_testing_matrix:
runs-on: ubuntu-latest
needs: [testing]
outputs:
all_tests_passed: ${{ steps.all_tests_passed.outputs.result }}
steps:
- name: Check all tests passed
id: all_tests_passed
run: |
success=true
for status in ${{ needs.testing.result }}; do
if [ $status != "success" ]; then
success=false
break
fi
done
echo "::set-output name=result::$success"
50 changes: 34 additions & 16 deletions .github/workflows/e2e-tests-pr.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: PR E2E (skip with label skip-e2e)
name: PR E2E

on:
pull_request_review:
Expand All @@ -7,28 +7,46 @@ on:
- 'master'

jobs:
# We disable this for now because cancelling runs makes the Cypress Cloud tests to hang.
# cancel-previous-runs:
# runs-on: ubuntu-latest
# name: 'Cancel previous e2e test runs'
# strategy:
# matrix:
# node-version: [16.x]

# steps:
# - name: 'Cancel previous runs'
# uses: styfle/cancel-workflow-action@0.9.0
# with:
# access_token: ${{ github.token }}

run-e2e-tests:
name: E2E [Electron/Node 16]
uses: ./.github/workflows/e2e-reusable.yml
if: ${{ github.event.review.state == 'approved' && !contains(github.event.pull_request.labels.*.name, 'skip-e2e') }}
if: ${{ github.event.review.state == 'approved' && !contains(github.event.pull_request.labels.*.name, 'community') }}
with:
branch: ${{ github.event.pull_request.head.ref }}
user: ${{ github.event.pull_request.user.login || 'PR User' }}
spec: 'e2e/*'
run-env: base:16.18.1
secrets:
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}

post-e2e-tests:
runs-on: ubuntu-latest
name: E2E [Electron/Node 16] - Checks
needs: [run-e2e-tests]
if: always()
steps:
- name: E2E success comment
if: ${{!contains(github.event.pull_request.labels.*.name, 'community') && needs.run-e2e-tests.outputs.tests_passed == 'true' }}
uses: peter-evans/create-or-update-comment@v3
with:
issue-number: ${{ github.event.pull_request.number }}
body: |
:white_check_mark: All Cypress E2E specs passed
token: ${{ secrets.GITHUB_TOKEN }}

- name: E2E fail comment
if: needs.run-e2e-tests.result == 'failure'
uses: peter-evans/create-or-update-comment@v3
with:
issue-number: ${{ github.event.pull_request.number }}
body: |
:warning: Some Cypress E2E specs are failing, please fix them before merging
token: ${{ secrets.GITHUB_TOKEN }}

- name: Success job if community PR
if: ${{ contains(github.event.pull_request.labels.*.name, 'community') }}
run: exit 0

- name: Fail job if run-e2e-tests failed
if: needs.run-e2e-tests.result == 'failure'
run: exit 1
15 changes: 1 addition & 14 deletions .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ jobs:
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' }}
Expand All @@ -51,22 +50,10 @@ jobs:
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]
needs: [run-e2e-tests]
if: ${{ github.event.inputs.success-url != '' }}
steps:
- name: Notify Slack on failure
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/release-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
permissions:
contents: write

timeout-minutes: 10
timeout-minutes: 60

steps:
- name: Checkout
Expand All @@ -31,14 +31,16 @@ jobs:
cache: 'pnpm'
- run: pnpm install --frozen-lockfile

- name: Set release version in env
run: echo "RELEASE=$(node -e 'console.log(require("./package.json").version)')" >> $GITHUB_ENV

- name: Build
run: pnpm build

- name: Publish to NPM
run: |
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
pnpm publish -r --publish-branch ${{github.event.pull_request.base.ref}} --access public
echo "RELEASE=$(node -e 'console.log(require("./package.json").version)')" >> $GITHUB_ENV
pnpm publish -r --publish-branch ${{github.event.pull_request.base.ref}} --access public --tag rc
- name: Create Release
uses: ncipollo/release-action@v1
Expand Down
42 changes: 42 additions & 0 deletions .github/workflows/release-push-to-channel.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: 'Release: Push to Channel'

on:
workflow_dispatch:
inputs:
version:
description: 'n8n Release version to push to a channel'
required: true

release-channel:
description: 'Release channel'
required: true
type: choice
default: 'next'
options:
- next
- latest

jobs:
release-to-npm:
name: Release to NPM
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/setup-node@v3
with:
node-version: 16.x
- run: |
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
npm dist-tag add n8n@${{ github.event.inputs.version }} ${{ github.event.inputs.release-channel }}
release-to-docker-hub:
name: Release to DockerHub
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- run: docker buildx imagetools create -t n8nio/n8n:${{ github.event.inputs.release-channel }} n8nio/n8n:${{ github.event.inputs.version }}
2 changes: 1 addition & 1 deletion .github/workflows/test-workflows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:

- uses: pnpm/action-setup@v2.2.4
with:
version: 7.27.0
version: 8.1.0

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
Expand Down
Loading

0 comments on commit dac374f

Please sign in to comment.