forked from n8n-io/n8n
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: Refactor linting workflow (no-changelog) (n8n-io#9714)
- Loading branch information
Showing
5 changed files
with
77 additions
and
62 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -46,34 +46,12 @@ jobs: | |
collectCoverage: true | ||
|
||
lint: | ||
name: Lint changes | ||
runs-on: ubuntu-latest | ||
name: Lint | ||
uses: ./.github/workflows/linting-reusable.yml | ||
needs: install-and-build | ||
steps: | ||
- uses: actions/[email protected] | ||
with: | ||
repository: n8n-io/n8n | ||
ref: ${{ inputs.branch }} | ||
|
||
- run: corepack enable | ||
- uses: actions/[email protected] | ||
with: | ||
node-version: 20.x | ||
cache: pnpm | ||
|
||
- name: Install dependencies | ||
run: pnpm install --frozen-lockfile | ||
|
||
- name: Restore cached build artifacts | ||
uses: actions/cache/[email protected] | ||
with: | ||
path: ./packages/**/dist | ||
key: ${{ github.sha }}-base:build | ||
|
||
- name: Lint | ||
env: | ||
CI_LINT_MASTER: true | ||
run: pnpm lint | ||
with: | ||
ref: ${{ inputs.branch }} | ||
cacheKey: ${{ github.sha }}-base:build | ||
|
||
notify-on-failure: | ||
name: Notify Slack on failure | ||
|
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 |
---|---|---|
|
@@ -3,7 +3,7 @@ name: Build, unit test and lint branch | |
on: [pull_request] | ||
|
||
jobs: | ||
install: | ||
install-and-build: | ||
name: Install & Build | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
@@ -36,35 +36,15 @@ jobs: | |
unit-test: | ||
name: Unit tests | ||
uses: ./.github/workflows/units-tests-reusable.yml | ||
needs: install | ||
needs: install-and-build | ||
with: | ||
ref: refs/pull/${{ github.event.pull_request.number }}/merge | ||
cacheKey: ${{ github.sha }}-base:build | ||
|
||
lint: | ||
name: Lint changes | ||
runs-on: ubuntu-latest | ||
needs: install | ||
steps: | ||
- uses: actions/[email protected] | ||
with: | ||
repository: n8n-io/n8n | ||
ref: refs/pull/${{ github.event.pull_request.number }}/merge | ||
|
||
- run: corepack enable | ||
- uses: actions/[email protected] | ||
with: | ||
node-version: 20.x | ||
cache: pnpm | ||
|
||
- name: Install dependencies | ||
run: pnpm install --frozen-lockfile | ||
|
||
- name: Restore cached build artifacts | ||
uses: actions/cache/[email protected] | ||
with: | ||
path: ./packages/**/dist | ||
key: ${{ github.sha }}-base:build | ||
|
||
- name: Lint | ||
run: pnpm lint | ||
name: Lint | ||
uses: ./.github/workflows/linting-reusable.yml | ||
needs: install-and-build | ||
with: | ||
ref: refs/pull/${{ github.event.pull_request.number }}/merge | ||
cacheKey: ${{ github.sha }}-base:build |
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,54 @@ | ||
name: Reusable linting workflow | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
ref: | ||
description: GitHub ref to lint. | ||
required: false | ||
type: string | ||
default: master | ||
cacheKey: | ||
description: Cache key for modules and build artifacts. | ||
required: false | ||
default: '' | ||
type: string | ||
|
||
jobs: | ||
lint: | ||
name: Lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/[email protected] | ||
with: | ||
repository: n8n-io/n8n | ||
ref: ${{ inputs.ref }} | ||
|
||
- run: corepack enable | ||
- uses: actions/[email protected] | ||
with: | ||
node-version: 20.x | ||
cache: pnpm | ||
|
||
- name: Install dependencies | ||
run: pnpm install --frozen-lockfile | ||
|
||
- name: Build | ||
if: ${{ inputs.cacheKey == '' }} | ||
run: pnpm build | ||
|
||
- name: Restore cached build artifacts | ||
if: ${{ inputs.cacheKey != '' }} | ||
uses: actions/cache/[email protected] | ||
with: | ||
path: ./packages/**/dist | ||
key: ${{ inputs.cacheKey }} | ||
|
||
- name: Lint Backend | ||
run: pnpm lint:backend | ||
|
||
- name: Lint Nodes | ||
run: pnpm lint:nodes | ||
|
||
- name: Lint Frontend | ||
run: pnpm lint:frontend |
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