2022-08-26 01:27:04 -07:00
|
|
|
name: Test Master
|
2019-12-24 16:25:44 -08:00
|
|
|
|
2022-08-26 01:27:04 -07:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
2019-12-24 16:25:44 -08:00
|
|
|
|
|
|
|
jobs:
|
2023-08-02 08:38:35 -07:00
|
|
|
install-and-build:
|
2019-12-24 16:25:44 -08:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
2022-03-16 02:32:49 -07:00
|
|
|
timeout-minutes: 30
|
|
|
|
|
2019-12-24 16:25:44 -08:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2023-07-12 06:03:23 -07:00
|
|
|
node-version: [18.x, 20.x]
|
2019-12-24 16:25:44 -08:00
|
|
|
|
|
|
|
steps:
|
2022-09-21 01:50:15 -07:00
|
|
|
- uses: actions/checkout@v3
|
|
|
|
|
2022-11-09 08:32:05 -08:00
|
|
|
- uses: pnpm/action-setup@v2.2.4
|
|
|
|
|
2022-08-19 06:34:02 -07:00
|
|
|
- name: Use Node.js ${{ matrix.node-version }}
|
2022-09-21 01:50:15 -07:00
|
|
|
uses: actions/setup-node@v3
|
2022-08-19 06:34:02 -07:00
|
|
|
with:
|
|
|
|
node-version: ${{ matrix.node-version }}
|
2023-08-02 08:38:35 -07:00
|
|
|
cache: pnpm
|
2022-09-21 01:50:15 -07:00
|
|
|
|
2022-11-09 08:32:05 -08:00
|
|
|
- name: Install dependencies
|
|
|
|
run: pnpm install --frozen-lockfile
|
2022-09-21 01:50:15 -07:00
|
|
|
|
|
|
|
- name: Build
|
2022-11-09 08:32:05 -08:00
|
|
|
run: pnpm build
|
2022-09-21 01:50:15 -07:00
|
|
|
|
2023-08-02 08:38:35 -07:00
|
|
|
- name: Cache build artifacts
|
|
|
|
uses: actions/cache@v3
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
/github/home/.cache
|
|
|
|
/github/home/.pnpm-store
|
|
|
|
./node_modules
|
|
|
|
./packages
|
|
|
|
key: ${{ github.sha }}-base:${{ matrix.node-version }}-test-lint
|
|
|
|
|
|
|
|
unit-test:
|
|
|
|
name: Unit tests
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: install-and-build
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
node-version: [18.x, 20.x]
|
|
|
|
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:${{ matrix.node-version }}-test-lint
|
|
|
|
|
|
|
|
- uses: pnpm/action-setup@v2.2.4
|
|
|
|
|
|
|
|
- name: Use Node.js ${{ matrix.node-version }}
|
|
|
|
uses: actions/setup-node@v3
|
|
|
|
with:
|
|
|
|
node-version: ${{ matrix.node-version }}
|
|
|
|
cache: pnpm
|
|
|
|
|
2022-09-21 01:50:15 -07:00
|
|
|
- name: Test
|
2022-11-09 08:32:05 -08:00
|
|
|
run: pnpm test
|
2022-11-08 04:21:10 -08: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-08-02 08:38:35 -07:00
|
|
|
lint:
|
|
|
|
name: Lint changes
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: install-and-build
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
node-version: [18.x, 20.x]
|
|
|
|
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:${{ matrix.node-version }}-test-lint
|
|
|
|
|
|
|
|
- uses: pnpm/action-setup@v2.2.4
|
|
|
|
|
|
|
|
- name: Use Node.js ${{ matrix.node-version }}
|
|
|
|
uses: actions/setup-node@v3
|
|
|
|
with:
|
|
|
|
node-version: ${{ matrix.node-version }}
|
|
|
|
cache: pnpm
|
|
|
|
|
2022-10-10 10:50:26 -07:00
|
|
|
- name: Lint
|
2022-11-11 07:07:50 -08:00
|
|
|
env:
|
|
|
|
CI_LINT_MASTER: true
|
2022-11-09 08:32:05 -08:00
|
|
|
run: pnpm lint
|
2022-11-17 09:52:03 -08:00
|
|
|
|
2023-08-02 08:38:35 -07:00
|
|
|
notify-on-failure:
|
|
|
|
name: Notify Slack on failure
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: [unit-test, lint]
|
|
|
|
steps:
|
2022-11-17 09:52:03 -08:00
|
|
|
- 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 }}
|
2022-12-20 05:13:24 -08:00
|
|
|
message: Master branch (build or test or lint) failed (${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})
|