2023-03-02 07:50:21 -08:00
|
|
|
name: Build, unit/smoke test and lint branch
|
2019-12-24 16:25:44 -08:00
|
|
|
|
2022-09-14 01:50:42 -07:00
|
|
|
on: [pull_request]
|
2019-12-24 16:25:44 -08:00
|
|
|
|
|
|
|
jobs:
|
2023-03-02 07:50:21 -08:00
|
|
|
install:
|
|
|
|
name: Install & Build
|
2019-12-24 16:25:44 -08:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2022-09-21 01:24:39 -07:00
|
|
|
- uses: actions/checkout@v3
|
2023-03-02 07:50:21 -08:00
|
|
|
with:
|
|
|
|
repository: n8n-io/n8n
|
|
|
|
ref: ${{ inputs.branch }}
|
2022-09-21 01:24:39 -07:00
|
|
|
|
2022-11-09 08:32:05 -08:00
|
|
|
- uses: pnpm/action-setup@v2.2.4
|
|
|
|
|
2023-06-02 06:23:28 -07:00
|
|
|
- name: Use Node.js 18
|
2022-09-20 11:59:49 -07:00
|
|
|
uses: actions/setup-node@v3
|
2022-08-19 06:34:02 -07:00
|
|
|
with:
|
2023-06-02 06:23:28 -07:00
|
|
|
node-version: 18.x
|
2023-03-02 07:50:21 -08:00
|
|
|
cache: pnpm
|
2022-09-21 01:24:39 -07:00
|
|
|
|
2022-11-09 08:32:05 -08:00
|
|
|
- name: Install dependencies
|
|
|
|
run: pnpm install --frozen-lockfile
|
2022-09-21 01:24:39 -07:00
|
|
|
|
2022-10-10 10:50:26 -07:00
|
|
|
- name: Build
|
2022-11-09 08:32:05 -08:00
|
|
|
run: pnpm build
|
2022-10-10 10:50:26 -07:00
|
|
|
|
2023-03-02 07:50:21 -08:00
|
|
|
- name: Cache build artifacts
|
|
|
|
uses: actions/cache@v3
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
/github/home/.cache
|
|
|
|
/github/home/.pnpm-store
|
|
|
|
./node_modules
|
|
|
|
./packages
|
2023-06-02 06:23:28 -07:00
|
|
|
key: ${{ github.sha }}-base:18-test-lint
|
2023-03-02 07:50:21 -08:00
|
|
|
|
|
|
|
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
|
2023-06-02 06:23:28 -07:00
|
|
|
key: ${{ github.sha }}-base:18-test-lint
|
2023-03-02 07:50:21 -08:00
|
|
|
|
|
|
|
- uses: pnpm/action-setup@v2.2.4
|
|
|
|
|
2023-06-02 06:23:28 -07:00
|
|
|
- name: Use Node.js 18
|
2023-03-02 07:50:21 -08:00
|
|
|
uses: actions/setup-node@v3
|
|
|
|
with:
|
2023-06-02 06:23:28 -07:00
|
|
|
node-version: 18.x
|
2023-03-02 07:50:21 -08:00
|
|
|
cache: pnpm
|
|
|
|
|
2022-10-10 10:50:26 -07:00
|
|
|
- name: Test
|
2022-11-09 08:32:05 -08:00
|
|
|
run: pnpm test
|
2022-10-10 10:50:26 -07:00
|
|
|
|
2023-03-10 07:53:05 -08:00
|
|
|
- name: Upload coverage to Codecov
|
|
|
|
uses: codecov/codecov-action@v3
|
|
|
|
with:
|
2023-05-17 07:40:53 -07:00
|
|
|
files: packages/@n8n/client-oauth2/coverage/cobertura-coverage.xml,packages/cli/coverage/cobertura-coverage.xml,packages/core/coverage/cobertura-coverage.xml,packages/design-system/coverage/cobertura-coverage.xml,packages/editor-ui/coverage/cobertura-coverage.xml,packages/nodes-base/coverage/cobertura-coverage.xml,packages/workflow/coverage/cobertura-coverage.xml
|
2023-03-10 07:53:05 -08:00
|
|
|
|
2023-03-02 07:50:21 -08:00
|
|
|
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
|
2023-06-02 06:23:28 -07:00
|
|
|
key: ${{ github.sha }}-base:18-test-lint
|
2023-03-02 07:50:21 -08:00
|
|
|
|
|
|
|
- uses: pnpm/action-setup@v2.2.4
|
|
|
|
|
2023-06-02 06:23:28 -07:00
|
|
|
- name: Use Node.js 18
|
2023-03-02 07:50:21 -08:00
|
|
|
uses: actions/setup-node@v3
|
|
|
|
with:
|
2023-06-02 06:23:28 -07:00
|
|
|
node-version: 18.x
|
2023-03-02 07:50:21 -08:00
|
|
|
cache: pnpm
|
2022-11-08 04:21:10 -08:00
|
|
|
|
2022-09-21 01:24:39 -07:00
|
|
|
- name: Fetch base branch for `git diff`
|
|
|
|
run: git fetch origin ${{ github.event.pull_request.base.ref }}:${{ github.event.pull_request.base.ref }}
|
|
|
|
|
|
|
|
- name: Run ESLint on changes only
|
2022-08-19 06:34:02 -07:00
|
|
|
env:
|
2022-09-21 01:24:39 -07:00
|
|
|
ESLINT_PLUGIN_DIFF_COMMIT: ${{ github.event.pull_request.base.ref }}
|
2022-11-09 08:32:05 -08:00
|
|
|
run: pnpm lint
|
2023-03-02 07:50:21 -08:00
|
|
|
|
|
|
|
smoke-test:
|
2023-06-02 06:23:28 -07:00
|
|
|
name: E2E [Electron/Node 18]
|
2023-03-02 07:50:21 -08:00
|
|
|
uses: ./.github/workflows/e2e-reusable.yml
|
|
|
|
with:
|
2023-04-27 04:09:50 -07:00
|
|
|
branch: ${{ github.event.pull_request.base.ref }}
|
2023-03-02 07:50:21 -08:00
|
|
|
user: ${{ github.event.inputs.user || 'PR User' }}
|
|
|
|
spec: ${{ github.event.inputs.spec || 'e2e/0-smoke.cy.ts' }}
|
|
|
|
record: false
|
|
|
|
parallel: false
|
2023-04-27 04:09:50 -07:00
|
|
|
pr_number: ${{ github.event.number }}
|
2023-03-02 07:50:21 -08:00
|
|
|
containers: '[1]'
|
|
|
|
secrets:
|
|
|
|
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
|
2023-03-09 03:49:37 -08:00
|
|
|
|
|
|
|
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.
|