2023-06-22 15:38:12 -07:00
|
|
|
name: Build, unit 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:
|
2024-01-26 02:26:30 -08:00
|
|
|
- uses: actions/checkout@v4.1.1
|
2023-03-02 07:50:21 -08:00
|
|
|
with:
|
|
|
|
repository: n8n-io/n8n
|
2023-10-13 01:44:26 -07:00
|
|
|
ref: refs/pull/${{ github.event.pull_request.number }}/merge
|
2022-09-21 01:24:39 -07:00
|
|
|
|
2024-02-02 00:47:58 -08:00
|
|
|
- run: corepack enable
|
2023-06-02 06:23:28 -07:00
|
|
|
- name: Use Node.js 18
|
2024-01-26 02:26:30 -08:00
|
|
|
uses: actions/setup-node@v4.0.1
|
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
|
2024-01-26 02:26:30 -08:00
|
|
|
uses: actions/cache/save@v4.0.0
|
2023-03-02 07:50:21 -08:00
|
|
|
with:
|
2023-08-22 02:21:16 -07:00
|
|
|
path: ./packages/**/dist
|
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
|
2023-09-13 06:24:02 -07:00
|
|
|
uses: ./.github/workflows/units-tests-reusable.yml
|
2023-03-02 07:50:21 -08:00
|
|
|
needs: install
|
2023-09-13 06:24:02 -07:00
|
|
|
with:
|
2023-10-13 01:44:26 -07:00
|
|
|
ref: refs/pull/${{ github.event.pull_request.number }}/merge
|
2023-09-13 06:24:02 -07:00
|
|
|
cacheKey: ${{ github.sha }}-base:18-test-lint
|
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:
|
2024-01-26 02:26:30 -08:00
|
|
|
- uses: actions/checkout@v4.1.1
|
2023-03-02 07:50:21 -08:00
|
|
|
with:
|
|
|
|
repository: n8n-io/n8n
|
2023-10-13 01:44:26 -07:00
|
|
|
ref: refs/pull/${{ github.event.pull_request.number }}/merge
|
2023-03-02 07:50:21 -08:00
|
|
|
|
2024-02-02 00:47:58 -08:00
|
|
|
- run: corepack enable
|
2023-06-02 06:23:28 -07:00
|
|
|
- name: Use Node.js 18
|
2024-01-26 02:26:30 -08:00
|
|
|
uses: actions/setup-node@v4.0.1
|
2023-03-02 07:50:21 -08: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-11-08 04:21:10 -08:00
|
|
|
|
2023-08-22 02:21:16 -07:00
|
|
|
- name: Install dependencies
|
|
|
|
run: pnpm install --frozen-lockfile
|
|
|
|
|
|
|
|
- name: Restore cached build artifacts
|
2024-01-26 02:26:30 -08:00
|
|
|
uses: actions/cache/restore@v4.0.0
|
2023-08-22 02:21:16 -07:00
|
|
|
with:
|
|
|
|
path: ./packages/**/dist
|
|
|
|
key: ${{ github.sha }}-base:18-test-lint
|
|
|
|
|
2023-09-14 07:55:06 -07:00
|
|
|
- name: Lint
|
2022-11-09 08:32:05 -08:00
|
|
|
run: pnpm lint
|