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: Parallelize unit tests on the CI (no-changelog)
- Loading branch information
Showing
10 changed files
with
249 additions
and
214 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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: 'Build and Cache' | ||
description: 'Build n8n and cache all the dist folders' | ||
inputs: | ||
buildTarget: | ||
type: choice | ||
default: 'build' | ||
options: | ||
- build | ||
- build:backend | ||
cacheKey: | ||
description: 'Cache key for modules and build artifacts' | ||
required: true | ||
type: string | ||
|
||
runs: | ||
using: 'composite' | ||
steps: | ||
- run: corepack enable | ||
shell: bash | ||
|
||
- uses: actions/setup-node@v4.0.1 | ||
with: | ||
node-version: 18.x | ||
cache: pnpm | ||
|
||
- run: pnpm install --frozen-lockfile | ||
shell: bash | ||
|
||
- run: pnpm ${{ inputs.buildTarget }} | ||
shell: bash | ||
|
||
- uses: actions/cache/save@v4.0.0 | ||
with: | ||
path: ./packages/**/dist | ||
key: ${{ inputs.cacheKey }} |
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,32 @@ | ||
name: 'Lint' | ||
description: 'Restore the dist folders from cache, and run linting' | ||
inputs: | ||
cacheKey: | ||
description: 'Cache key to restore build artifacts from' | ||
required: true | ||
type: string | ||
|
||
runs: | ||
using: 'composite' | ||
strategy: | ||
matrix: | ||
group: [backend, frontend, nodes] | ||
steps: | ||
- run: corepack enable | ||
shell: bash | ||
|
||
- uses: actions/setup-node@v4.0.1 | ||
with: | ||
node-version: 18.x | ||
cache: pnpm | ||
|
||
- run: pnpm install --frozen-lockfile | ||
shell: bash | ||
|
||
- uses: actions/cache/restore@v4.0.0 | ||
with: | ||
path: ./packages/**/dist | ||
key: ${{ inputs.cacheKey }} | ||
|
||
- run: pnpm lint:${{ matrix.group }} | ||
shell: bash |
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,49 @@ | ||
name: 'Unit tests' | ||
description: 'Restore the dist folders from cache, and run tests' | ||
inputs: | ||
cacheKey: | ||
description: 'Cache key to restore build artifacts from' | ||
required: true | ||
type: string | ||
nodeVersion: | ||
description: 'Version of node to use.' | ||
required: false | ||
type: string | ||
default: '18.x' | ||
collectCoverage: | ||
required: false | ||
type: string | ||
default: 'false' | ||
|
||
runs: | ||
using: 'composite' | ||
strategy: | ||
matrix: | ||
group: [backend, frontend, nodes] | ||
steps: | ||
- run: corepack enable | ||
shell: bash | ||
|
||
- uses: actions/setup-node@v4.0.1 | ||
with: | ||
node-version: ${{ inputs.nodeVersion }} | ||
cache: pnpm | ||
|
||
- run: pnpm install --frozen-lockfile | ||
shell: bash | ||
|
||
- uses: actions/cache/restore@v4.0.0 | ||
with: | ||
path: ./packages/**/dist | ||
key: ${{ inputs.cacheKey }} | ||
|
||
- run: pnpm test:${{ matrix.group }} | ||
shell: bash | ||
env: | ||
COVERAGE_ENABLED: ${{ inputs.collectCoverage }} | ||
|
||
- uses: actions/cache/save@v4.0.0 | ||
if: ${{ inputs.collectCoverage == 'true' }} | ||
with: | ||
path: ./packages/**/coverage | ||
key: ${{ inputs.cacheKey }}:${{ matrix.group }}:coverage |
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
Oops, something went wrong.