Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Use turbo for build cache (no-changelog) #9696

Merged
merged 1 commit into from
Jul 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/ci-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ jobs:
- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Setup build cache
uses: rharkor/caching-for-turbo@v1.5

- name: Build
run: pnpm build

Expand Down
14 changes: 13 additions & 1 deletion .github/workflows/ci-postgres-mysql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ jobs:
cache: 'pnpm'
- run: pnpm install --frozen-lockfile

- name: Setup build cache
uses: rharkor/caching-for-turbo@v1.5

- name: Build Backend
run: pnpm build:backend

Expand All @@ -52,6 +55,9 @@ jobs:
cache: 'pnpm'
- run: pnpm install --frozen-lockfile

- name: Setup build cache
uses: rharkor/caching-for-turbo@v1.5

- name: Restore cached build artifacts
uses: actions/cache/restore@v4.0.0
with:
Expand All @@ -60,7 +66,7 @@ jobs:

- name: Test SQLite Pooled
working-directory: packages/cli
run: pnpm jest --coverage
run: pnpm jest
netroy marked this conversation as resolved.
Show resolved Hide resolved

mysql:
name: MySQL
Expand All @@ -78,6 +84,9 @@ jobs:
cache: 'pnpm'
- run: pnpm install --frozen-lockfile

- name: Setup build cache
uses: rharkor/caching-for-turbo@v1.5

- name: Restore cached build artifacts
uses: actions/cache/restore@v4.0.0
with:
Expand Down Expand Up @@ -112,6 +121,9 @@ jobs:
cache: 'pnpm'
- run: pnpm install --frozen-lockfile

- name: Setup build cache
uses: rharkor/caching-for-turbo@v1.5

- name: Restore cached build artifacts
uses: actions/cache/restore@v4.0.0
with:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/ci-pull-requests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ jobs:
- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Setup build cache
uses: rharkor/caching-for-turbo@v1.5

- name: Build
run: pnpm build

Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/linting-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ jobs:
- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Setup build cache
uses: rharkor/caching-for-turbo@v1.5

- name: Build
if: ${{ inputs.cacheKey == '' }}
run: pnpm build
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/units-tests-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ jobs:
- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Setup build cache
uses: rharkor/caching-for-turbo@v1.5

- name: Build
if: ${{ inputs.cacheKey == '' }}
run: pnpm build
Expand Down
21 changes: 11 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,27 +11,28 @@
"scripts": {
"preinstall": "node scripts/block-npm-install.js",
"build": "turbo run build",
"build:backend": "pnpm --filter=!@n8n/chat --filter=!@n8n/codemirror-lang --filter=!n8n-design-system --filter=!n8n-editor-ui build",
"build:frontend": "pnpm --filter=@n8n/chat --filter=@n8n/codemirror-lang --filter=n8n-design-system --filter=n8n-editor-ui build",
"typecheck": "pnpm --filter=!n8n typecheck",
"build:backend": "turbo run build:backend",
"build:frontend": "turbo run build:frontend",
"build:nodes": "turbo run build:nodes",
"typecheck": "turbo --filter=!n8n typecheck",
"dev": "turbo run dev --parallel --filter=!n8n-design-system --filter=!@n8n/chat",
"dev:ai": "turbo run dev --parallel --filter=@n8n/nodes-langchain --filter=n8n --filter=n8n-core",
"clean": "turbo run clean --parallel",
"format": "turbo run format && node scripts/format.mjs",
"lint": "turbo run lint",
"lintfix": "turbo run lintfix",
"lint:backend": "pnpm --filter=!@n8n/chat --filter=!@n8n/codemirror-lang --filter=!n8n-design-system --filter=!n8n-editor-ui --filter=!n8n-nodes-base --filter=!@n8n/n8n-nodes-langchain lint",
"lint:nodes": "pnpm --filter=n8n-nodes-base --filter=@n8n/n8n-nodes-langchain lint",
"lint:frontend": "pnpm --filter=@n8n/chat --filter=@n8n/codemirror-lang --filter=n8n-design-system --filter=n8n-editor-ui lint",
"lint:backend": "turbo run lint:backend",
"lint:nodes": "turbo run lint:nodes",
"lint:frontend": "turbo run lint:frontend",
"optimize-svg": "find ./packages -name '*.svg' ! -name 'pipedrive.svg' -print0 | xargs -0 -P16 -L20 npx svgo",
"start": "run-script-os",
"start:default": "cd packages/cli/bin && ./n8n",
"start:tunnel": "./packages/cli/bin/n8n start --tunnel",
"start:windows": "cd packages/cli/bin && n8n",
"test": "turbo run test",
"test:backend": "pnpm --filter=!@n8n/chat --filter=!@n8n/codemirror-lang --filter=!n8n-design-system --filter=!n8n-editor-ui --filter=!n8n-nodes-base --filter=!@n8n/n8n-nodes-langchain test",
"test:nodes": "pnpm --filter=n8n-nodes-base --filter=@n8n/n8n-nodes-langchain test",
"test:frontend": "pnpm --filter=@n8n/chat --filter=@n8n/codemirror-lang --filter=n8n-design-system --filter=n8n-editor-ui test",
"test:backend": "turbo run test:backend --concurrency=1",
"test:frontend": "turbo run test:frontend --concurrency=1",
"test:nodes": "turbo run test:nodes --concurrency=1",
"watch": "turbo run watch --parallel",
"webhook": "./packages/cli/bin/n8n webhook",
"worker": "./packages/cli/bin/n8n worker"
Expand All @@ -55,7 +56,7 @@
"ts-jest": "^29.1.1",
"tsc-alias": "^1.8.7",
"tsc-watch": "^6.0.4",
"turbo": "1.13.3",
"turbo": "2.0.6",
"typescript": "*",
"vite": "^5.2.12",
"vitest": "^1.6.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/@n8n/chat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"build:bundle": "INCLUDE_VUE=true vite build",
"preview": "vite preview",
"test:dev": "vitest",
"test": "vitest run --coverage",
"test": "vitest run",
"typecheck": "vue-tsc --noEmit",
"lint": "eslint . --ext .js,.ts,.vue --quiet",
"lintfix": "eslint . --ext .js,.ts,.vue --fix",
Expand Down
58 changes: 29 additions & 29 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

63 changes: 60 additions & 3 deletions turbo.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,74 @@
{
"$schema": "https://turborepo.org/schema.json",
"pipeline": {
"$schema": "https://turbo.build/schema.json",
"ui": "stream",
"tasks": {
"clean": {
"cache": false
},
"build:backend": {
"dependsOn": ["n8n#build"]
},
"build:frontend": {
"dependsOn": ["n8n-editor-ui#build"]
},
"build:nodes": {
"dependsOn": ["n8n-nodes-base#build", "@n8n/n8n-nodes-langchain#build"]
},
"build": {
"dependsOn": ["^build"],
"outputs": ["dist/**"]
},
"typecheck": {},
"typecheck": {
"dependsOn": ["^typecheck"]
},
"format": {},
"lint:backend": {
"dependsOn": [
"@n8n/client-oauth2#lint",
"@n8n/imap#lint",
"@n8n/permissions#lint",
"n8n-workflow#lint",
"n8n-core#lint",
"n8n-node-dev#lint",
"n8n#lint"
]
},
"lint:frontend": {
"dependsOn": [
"@n8n/chat#lint",
"@n8n/codemirror-lang#lint",
"@n8n/storybook#lint",
"n8n-cypress#lint",
"n8n-design-system#lint",
"n8n-editor-ui#lint"
]
},
"lint:nodes": {
"dependsOn": ["n8n-nodes-base#lint", "@n8n/n8n-nodes-langchain#lint"]
},
"lint": {},
"lintfix": {},
"test:backend": {
"dependsOn": [
"@n8n/client-oauth2#test",
"@n8n/imap#test",
"@n8n/permissions#test",
"n8n-workflow#test",
"n8n-core#test",
"n8n#test"
]
},
"test:frontend": {
"dependsOn": [
"@n8n/chat#test",
"@n8n/codemirror-lang#test",
"n8n-design-system#test",
"n8n-editor-ui#test"
]
},
"test:nodes": {
"dependsOn": ["n8n-nodes-base#test", "@n8n/n8n-nodes-langchain#test"]
},
"test": {},
"watch": {
"cache": false,
Expand Down
Loading