From 58952b3ef4ed64336d7abce2f95a497383e7ce32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E0=A4=95=E0=A4=BE=E0=A4=B0=E0=A4=A4=E0=A5=8B=E0=A4=AB?= =?UTF-8?q?=E0=A5=8D=E0=A4=AB=E0=A5=87=E0=A4=B2=E0=A4=B8=E0=A5=8D=E0=A4=95?= =?UTF-8?q?=E0=A5=8D=E0=A4=B0=E0=A4=BF=E0=A4=AA=E0=A5=8D=E0=A4=9F=E2=84=A2?= Date: Tue, 11 Jun 2024 00:38:07 +0200 Subject: [PATCH] ci: Use turbo for build cache (no-changelog) --- .github/workflows/ci-master.yml | 3 ++ .github/workflows/ci-postgres-mysql.yml | 14 +++++- .github/workflows/ci-pull-requests.yml | 3 ++ .github/workflows/linting-reusable.yml | 3 ++ .github/workflows/units-tests-reusable.yml | 3 ++ package.json | 13 ++--- packages/@n8n/chat/package.json | 2 +- pnpm-lock.yaml | 58 +++++++++++----------- turbo.json | 35 ++++++++++++- 9 files changed, 95 insertions(+), 39 deletions(-) diff --git a/.github/workflows/ci-master.yml b/.github/workflows/ci-master.yml index 938335558e3ba..32dd70df487fb 100644 --- a/.github/workflows/ci-master.yml +++ b/.github/workflows/ci-master.yml @@ -23,6 +23,9 @@ jobs: - name: Install dependencies run: pnpm install --frozen-lockfile + - name: Setup build cache + uses: dtinth/setup-github-actions-caching-for-turbo@v1.3.0 + - name: Build run: pnpm build diff --git a/.github/workflows/ci-postgres-mysql.yml b/.github/workflows/ci-postgres-mysql.yml index 16d446cc920e6..2d471c743e890 100644 --- a/.github/workflows/ci-postgres-mysql.yml +++ b/.github/workflows/ci-postgres-mysql.yml @@ -26,6 +26,9 @@ jobs: cache: 'pnpm' - run: pnpm install --frozen-lockfile + - name: Setup build cache + uses: dtinth/setup-github-actions-caching-for-turbo@v1.3.0 + - name: Build Backend run: pnpm build:backend @@ -52,6 +55,9 @@ jobs: cache: 'pnpm' - run: pnpm install --frozen-lockfile + - name: Setup build cache + uses: dtinth/setup-github-actions-caching-for-turbo@v1.3.0 + - name: Restore cached build artifacts uses: actions/cache/restore@v4.0.0 with: @@ -60,7 +66,7 @@ jobs: - name: Test SQLite Pooled working-directory: packages/cli - run: pnpm jest --coverage + run: pnpm jest mysql: name: MySQL @@ -78,6 +84,9 @@ jobs: cache: 'pnpm' - run: pnpm install --frozen-lockfile + - name: Setup build cache + uses: dtinth/setup-github-actions-caching-for-turbo@v1.3.0 + - name: Restore cached build artifacts uses: actions/cache/restore@v4.0.0 with: @@ -112,6 +121,9 @@ jobs: cache: 'pnpm' - run: pnpm install --frozen-lockfile + - name: Setup build cache + uses: dtinth/setup-github-actions-caching-for-turbo@v1.3.0 + - name: Restore cached build artifacts uses: actions/cache/restore@v4.0.0 with: diff --git a/.github/workflows/ci-pull-requests.yml b/.github/workflows/ci-pull-requests.yml index 1bdd6c60b96ee..f6b08332658fc 100644 --- a/.github/workflows/ci-pull-requests.yml +++ b/.github/workflows/ci-pull-requests.yml @@ -21,6 +21,9 @@ jobs: - name: Install dependencies run: pnpm install --frozen-lockfile + - name: Setup build cache + uses: dtinth/setup-github-actions-caching-for-turbo@v1.3.0 + - name: Build run: pnpm build diff --git a/.github/workflows/linting-reusable.yml b/.github/workflows/linting-reusable.yml index 69bccd9ce6216..374772a103e0f 100644 --- a/.github/workflows/linting-reusable.yml +++ b/.github/workflows/linting-reusable.yml @@ -33,6 +33,9 @@ jobs: - name: Install dependencies run: pnpm install --frozen-lockfile + - name: Setup build cache + uses: dtinth/setup-github-actions-caching-for-turbo@v1.3.0 + - name: Build if: ${{ inputs.cacheKey == '' }} run: pnpm build diff --git a/.github/workflows/units-tests-reusable.yml b/.github/workflows/units-tests-reusable.yml index 61ed73672e7a6..b1eb37584a63c 100644 --- a/.github/workflows/units-tests-reusable.yml +++ b/.github/workflows/units-tests-reusable.yml @@ -45,6 +45,9 @@ jobs: - name: Install dependencies run: pnpm install --frozen-lockfile + - name: Setup build cache + uses: dtinth/setup-github-actions-caching-for-turbo@v1.3.0 + - name: Build if: ${{ inputs.cacheKey == '' }} run: pnpm build diff --git a/package.json b/package.json index ffa1624b7b289..f7c8ad94b057b 100644 --- a/package.json +++ b/package.json @@ -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", @@ -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" @@ -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", diff --git a/packages/@n8n/chat/package.json b/packages/@n8n/chat/package.json index ca626386b7d3f..a766512947a76 100644 --- a/packages/@n8n/chat/package.json +++ b/packages/@n8n/chat/package.json @@ -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", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4f0389cbc2fc7..cf10d9ec46527 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -100,8 +100,8 @@ importers: specifier: ^6.0.4 version: 6.0.4(typescript@5.4.2) turbo: - specifier: 1.13.3 - version: 1.13.3 + specifier: 2.0.4 + version: 2.0.4 typescript: specifier: ^5.4.2 version: 5.4.2 @@ -12869,38 +12869,38 @@ packages: resolution: {integrity: sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==} engines: {node: '>=0.6.11 <=0.7.0 || >=0.7.3'} - turbo-darwin-64@1.13.3: - resolution: {integrity: sha512-glup8Qx1qEFB5jerAnXbS8WrL92OKyMmg5Hnd4PleLljAeYmx+cmmnsmLT7tpaVZIN58EAAwu8wHC6kIIqhbWA==} + turbo-darwin-64@2.0.4: + resolution: {integrity: sha512-x9mvmh4wudBstML8Z8IOmokLWglIhSfhQwnh2gBCSqabgVBKYvzl8Y+i+UCNPxheCGTgtsPepTcIaKBIyFIcvw==} cpu: [x64] os: [darwin] - turbo-darwin-arm64@1.13.3: - resolution: {integrity: sha512-/np2xD+f/+9qY8BVtuOQXRq5f9LehCFxamiQnwdqWm5iZmdjygC5T3uVSYuagVFsZKMvX3ycySwh8dylGTl6lg==} + turbo-darwin-arm64@2.0.4: + resolution: {integrity: sha512-/B1Ih8zPRGVw5vw4SlclOf3C/woJ/2T6ieH6u54KT4wypoaVyaiyMqBcziIXycdObIYr7jQ+raHO7q3mhay9/A==} cpu: [arm64] os: [darwin] - turbo-linux-64@1.13.3: - resolution: {integrity: sha512-G+HGrau54iAnbXLfl+N/PynqpDwi/uDzb6iM9hXEDG+yJnSJxaHMShhOkXYJPk9offm9prH33Khx2scXrYVW1g==} + turbo-linux-64@2.0.4: + resolution: {integrity: sha512-6aG670e5zOWu6RczEYcB81nEl8EhiGJEvWhUrnAfNEUIMBEH1pR5SsMmG2ol5/m3PgiRM12r13dSqTxCLcHrVg==} cpu: [x64] os: [linux] - turbo-linux-arm64@1.13.3: - resolution: {integrity: sha512-qWwEl5VR02NqRyl68/3pwp3c/olZuSp+vwlwrunuoNTm6JXGLG5pTeme4zoHNnk0qn4cCX7DFrOboArlYxv0wQ==} + turbo-linux-arm64@2.0.4: + resolution: {integrity: sha512-AXfVOjst+mCtPDFT4tCu08Qrfv12Nj7NDd33AjGwV79NYN1Y1rcFY59UQ4nO3ij3rbcvV71Xc+TZJ4csEvRCSg==} cpu: [arm64] os: [linux] - turbo-windows-64@1.13.3: - resolution: {integrity: sha512-Nudr4bRChfJzBPzEmpVV85VwUYRCGKecwkBFpbp2a4NtrJ3+UP1VZES653ckqCu2FRyRuS0n03v9euMbAvzH+Q==} + turbo-windows-64@2.0.4: + resolution: {integrity: sha512-QOnUR9hKl0T5gq5h1fAhVEqBSjpcBi/BbaO71YGQNgsr6pAnCQdbG8/r3MYXet53efM0KTdOhieWeO3KLNKybA==} cpu: [x64] os: [win32] - turbo-windows-arm64@1.13.3: - resolution: {integrity: sha512-ouJCgsVLd3icjRLmRvHQDDZnmGzT64GBupM1Y+TjtYn2LVaEBoV6hicFy8x5DUpnqdLy+YpCzRMkWlwhmkX7sQ==} + turbo-windows-arm64@2.0.4: + resolution: {integrity: sha512-3v8WpdZy1AxZw0gha0q3caZmm+0gveBQ40OspD6mxDBIS+oBtO5CkxhIXkFJJW+jDKmDlM7wXDIGfMEq+QyNCQ==} cpu: [arm64] os: [win32] - turbo@1.13.3: - resolution: {integrity: sha512-n17HJv4F4CpsYTvKzUJhLbyewbXjq1oLCi90i5tW1TiWDz16ML1eDG7wi5dHaKxzh5efIM56SITnuVbMq5dk4g==} + turbo@2.0.4: + resolution: {integrity: sha512-Ilme/2Q5kYw0AeRr+aw3s02+WrEYaY7U8vPnqSZU/jaDG/qd6jHVN6nRWyd/9KXvJGYM69vE6JImoGoyNjLwaw==} hasBin: true tween-functions@1.2.0: @@ -28015,32 +28015,32 @@ snapshots: tunnel@0.0.6: {} - turbo-darwin-64@1.13.3: + turbo-darwin-64@2.0.4: optional: true - turbo-darwin-arm64@1.13.3: + turbo-darwin-arm64@2.0.4: optional: true - turbo-linux-64@1.13.3: + turbo-linux-64@2.0.4: optional: true - turbo-linux-arm64@1.13.3: + turbo-linux-arm64@2.0.4: optional: true - turbo-windows-64@1.13.3: + turbo-windows-64@2.0.4: optional: true - turbo-windows-arm64@1.13.3: + turbo-windows-arm64@2.0.4: optional: true - turbo@1.13.3: + turbo@2.0.4: optionalDependencies: - turbo-darwin-64: 1.13.3 - turbo-darwin-arm64: 1.13.3 - turbo-linux-64: 1.13.3 - turbo-linux-arm64: 1.13.3 - turbo-windows-64: 1.13.3 - turbo-windows-arm64: 1.13.3 + turbo-darwin-64: 2.0.4 + turbo-darwin-arm64: 2.0.4 + turbo-linux-64: 2.0.4 + turbo-linux-arm64: 2.0.4 + turbo-windows-64: 2.0.4 + turbo-windows-arm64: 2.0.4 tween-functions@1.2.0: {} diff --git a/turbo.json b/turbo.json index f0b0521623c1a..fad458d652d36 100644 --- a/turbo.json +++ b/turbo.json @@ -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/**"] @@ -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,