-
Notifications
You must be signed in to change notification settings - Fork 9.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into n8n-3921-switch-client-oauth2-for-own-helpers
- Loading branch information
Showing
884 changed files
with
10,460 additions
and
5,950 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
packages/cli/src/databases/migrations/ @n8n-io/migrations-review |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,99 @@ | ||
name: Test Pull Requests | ||
name: Build, unit/smoke test and lint branch | ||
|
||
on: [pull_request] | ||
|
||
jobs: | ||
build: | ||
install: | ||
name: Install & Build | ||
runs-on: ubuntu-latest | ||
|
||
timeout-minutes: 30 | ||
|
||
strategy: | ||
matrix: | ||
node-version: [14.x, 16.x] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
repository: n8n-io/n8n | ||
ref: ${{ inputs.branch }} | ||
|
||
- uses: pnpm/[email protected] | ||
|
||
- name: Use Node.js ${{ matrix.node-version }} | ||
- name: Use Node.js 16 | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
cache: 'pnpm' | ||
node-version: 16.x | ||
cache: pnpm | ||
|
||
- name: Install dependencies | ||
run: pnpm install --frozen-lockfile | ||
|
||
- name: Build | ||
run: pnpm build | ||
|
||
- name: Cache build artifacts | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
/github/home/.cache | ||
/github/home/.pnpm-store | ||
./node_modules | ||
./packages | ||
key: ${{ github.sha }}-base:16.18.1-test-lint | ||
|
||
unit-test: | ||
name: Unit tests | ||
runs-on: ubuntu-latest | ||
needs: install | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
repository: n8n-io/n8n | ||
ref: ${{ inputs.branch }} | ||
|
||
- name: Restore cached build artifacts | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
/github/home/.cache | ||
/github/home/.pnpm-store | ||
./node_modules | ||
./packages | ||
key: ${{ github.sha }}-base:16.18.1-test-lint | ||
|
||
- uses: pnpm/[email protected] | ||
|
||
- name: Use Node.js 16 | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16.x | ||
cache: pnpm | ||
|
||
- name: Test | ||
run: pnpm test | ||
|
||
- name: Test E2E | ||
run: | | ||
pnpm cypress:install | ||
pnpm test:e2e:smoke | ||
lint: | ||
name: Lint changes | ||
runs-on: ubuntu-latest | ||
needs: install | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
repository: n8n-io/n8n | ||
ref: ${{ inputs.branch }} | ||
|
||
- name: Restore cached build artifacts | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
/github/home/.cache | ||
/github/home/.pnpm-store | ||
./node_modules | ||
./packages | ||
key: ${{ github.sha }}-base:16.18.1-test-lint | ||
|
||
- uses: pnpm/[email protected] | ||
|
||
- name: Use Node.js 16 | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16.x | ||
cache: pnpm | ||
|
||
- name: Fetch base branch for `git diff` | ||
run: git fetch origin ${{ github.event.pull_request.base.ref }}:${{ github.event.pull_request.base.ref }} | ||
|
@@ -44,3 +102,30 @@ jobs: | |
env: | ||
ESLINT_PLUGIN_DIFF_COMMIT: ${{ github.event.pull_request.base.ref }} | ||
run: pnpm lint | ||
|
||
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' }} | ||
spec: ${{ github.event.inputs.spec || 'e2e/0-smoke.cy.ts' }} | ||
run-env: base:16.18.1 | ||
record: false | ||
parallel: false | ||
containers: '[1]' | ||
secrets: | ||
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} | ||
|
||
checklist_job: | ||
runs-on: ubuntu-latest | ||
name: Checklist job | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v1 | ||
- name: Checklist | ||
uses: wyozi/contextual-qa-checklist-action@master | ||
with: | ||
gh-token: ${{ secrets.GITHUB_TOKEN }} | ||
comment-footer: Make sure to check off this list before asking for review. |
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,150 @@ | ||
name: Reusable e2e workflow | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
branch: | ||
description: 'GitHub branch to test.' | ||
required: false | ||
type: string | ||
default: 'master' | ||
user: | ||
description: 'User who kicked this off.' | ||
required: false | ||
type: string | ||
default: 'schedule' | ||
spec: | ||
description: 'Specify specs.' | ||
required: false | ||
default: 'e2e/*' | ||
type: string | ||
run-env: | ||
description: 'Node env version to run tests with.' | ||
required: false | ||
default: 'browsers:node16.18.0-chrome90-ff88' | ||
type: string | ||
cache-key: | ||
description: 'Cache key for modules and build artifacts.' | ||
required: false | ||
default: ${{ github.sha }}-${{ inputs.run-env }}-e2e-modules | ||
type: string | ||
record: | ||
description: 'Record test run.' | ||
required: false | ||
default: true | ||
type: boolean | ||
parallel: | ||
description: 'Run tests in parallel.' | ||
required: false | ||
default: true | ||
type: boolean | ||
containers: | ||
description: 'Number of containers to run tests in.' | ||
required: false | ||
default: '[1, 2, 3, 4, 5, 6, 7, 8]' | ||
type: string | ||
secrets: | ||
CYPRESS_RECORD_KEY: | ||
description: 'Cypress record key.' | ||
required: true | ||
|
||
jobs: | ||
# single job that generates and outputs a common id | ||
prepare: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
uuid: ${{ steps.uuid.outputs.value }} | ||
steps: | ||
- name: Generate unique ID 💎 | ||
id: uuid | ||
# take the current commit + timestamp together | ||
# the typical value would be something like | ||
# "sha-5d3fe...35d3-time-1620841214" | ||
run: echo "value=sha-$GITHUB_SHA-time-$(date +"%s")" >> $GITHUB_OUTPUT | ||
|
||
install: | ||
runs-on: ubuntu-latest | ||
needs: ['prepare'] | ||
container: | ||
image: cypress/${{ inputs.run-env }} | ||
options: --user 1001 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
repository: n8n-io/n8n | ||
ref: ${{ inputs.branch }} | ||
|
||
- name: Setup pnpm | ||
uses: pnpm/[email protected] | ||
with: | ||
run_install: true | ||
|
||
- name: Cache pnpm modules | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
/github/home/.cache | ||
/github/home/.pnpm-store | ||
./node_modules | ||
./packages | ||
key: ${{ inputs.cache-key }} | ||
|
||
- name: Cypress build | ||
uses: cypress-io/github-action@v5 | ||
with: | ||
# Disable running of tests within install job | ||
runTests: false | ||
install: false | ||
build: pnpm build | ||
|
||
- name: Cypress install | ||
run: pnpm cypress:install | ||
|
||
testing: | ||
runs-on: ubuntu-latest | ||
container: | ||
image: cypress/${{ inputs.run-env }} | ||
options: --user 1001 | ||
needs: ['prepare', 'install'] | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
containers: ${{ fromJSON(inputs.containers) }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
repository: n8n-io/n8n | ||
ref: ${{ inputs.branch }} | ||
|
||
- name: Setup pnpm | ||
uses: pnpm/[email protected] | ||
|
||
- name: Restore cached pnpm modules | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
/github/home/.cache | ||
/github/home/.pnpm-store | ||
./node_modules | ||
./packages | ||
key: ${{ inputs.cache-key }} | ||
|
||
- name: Cypress run | ||
uses: cypress-io/github-action@v5 | ||
with: | ||
install: false | ||
start: pnpm start | ||
wait-on: 'http://localhost:5678' | ||
wait-on-timeout: 120 # | ||
record: ${{ inputs.record }} | ||
parallel: ${{ inputs.parallel }} | ||
# 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 }} | ||
spec: "/__w/n8n/n8n/cypress/${{ inputs.spec }}" | ||
config-file: /__w/n8n/n8n/cypress.config.js | ||
env: | ||
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
E2E_TESTS: true | ||
COMMIT_INFO_MESSAGE: 🌳 ${{ inputs.branch }} 🖥️ ${{ inputs.run-env }} 🤖 ${{ inputs.user }} 🗃️ ${{ inputs.spec }} |
Oops, something went wrong.