Skip to content

Commit

Permalink
ci: Use turbo for build cache (no-changelog)
Browse files Browse the repository at this point in the history
  • Loading branch information
netroy committed Jun 24, 2024
1 parent 2ce97be commit 6b8de45
Show file tree
Hide file tree
Showing 9 changed files with 95 additions and 39 deletions.
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/[email protected]

- 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/[email protected]

- 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/[email protected]

- name: Restore cached build artifacts
uses: actions/cache/[email protected]
with:
Expand All @@ -60,7 +66,7 @@ jobs:

- name: Test SQLite Pooled
working-directory: packages/cli
run: pnpm jest --coverage
run: pnpm jest

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

- name: Setup build cache
uses: rharkor/[email protected]

- name: Restore cached build artifacts
uses: actions/cache/[email protected]
with:
Expand Down Expand Up @@ -112,6 +121,9 @@ jobs:
cache: 'pnpm'
- run: pnpm install --frozen-lockfile

- name: Setup build cache
uses: rharkor/[email protected]

- name: Restore cached build artifacts
uses: actions/cache/[email protected]
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/[email protected]

- 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/[email protected]

- 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 @@ -45,6 +45,9 @@ jobs:
- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Setup build cache
uses: rharkor/[email protected]

- name: Build
if: ${{ inputs.cacheKey == '' }}
run: pnpm build
Expand Down
13 changes: 7 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@
"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",
"build:backend": "turbo run build:backend",
"build:frontend": "turbo run build:frontend",
"build:nodes": "turbo run build:nodes",
"typecheck": "pnpm --filter=!@n8n/storybook --filter=!n8n-core --filter=!n8n-workflow --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",
Expand All @@ -29,9 +30,9 @@
"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.4",
"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 @@ -12,7 +12,7 @@
"build:pack": "node scripts/pack.js",
"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.

35 changes: 33 additions & 2 deletions turbo.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
{
"$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/**"]
Expand All @@ -12,6 +22,27 @@
"format": {},
"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

0 comments on commit 6b8de45

Please sign in to comment.