Przeglądaj źródła

Refactor bundlewatch workflow to use Turbo (#2119)

Paweł Kuna 7 miesięcy temu
rodzic
commit
a370919ebe

+ 4 - 0
.changeset/metal-carrots-battle.md

@@ -0,0 +1,4 @@
+---
+---
+
+Refactor bundlewatch workflow to use Turbo 

+ 8 - 3
.github/workflows/bundlewatch.yml

@@ -19,6 +19,14 @@ jobs:
       - name: Clone repository
         uses: actions/checkout@v4
 
+      - name: Cache turbo build setup
+        uses: actions/cache@v4
+        with: 
+          path: .turbo
+          key: ${{ runner.os }}-turbo-${{ github.sha }}
+          restore-keys: |
+            ${{ runner.os }}-turbo-
+
       - name: Set up Node.js
         uses: actions/setup-node@v4
         with:
@@ -36,9 +44,6 @@ jobs:
       - name: Install pnpm dependencies
         run: pnpm install --no-frozen-lockfile
 
-      - name: Run build
-        run: pnpm run build
-
       - name: Run bundlewatch
         run: pnpm run bundlewatch
         env:

+ 9 - 2
.github/workflows/test.yml

@@ -1,8 +1,7 @@
 name: Test build
 
 on:
-  pull_request:
-    types: [ opened, reopened ]
+  pull_request: null
 
 env:
   NODE: 20
@@ -17,6 +16,14 @@ jobs:
       - name: Clone repository
         uses: actions/checkout@v4
 
+      - name: Cache turbo build setup
+        uses: actions/cache@v4
+        with: 
+          path: .turbo
+          key: ${{ runner.os }}-turbo-${{ github.sha }}
+          restore-keys: |
+            ${{ runner.os }}-turbo-
+
       - name: Set up Node.js
         uses: actions/setup-node@v4
         with:

+ 1 - 0
package.json

@@ -6,6 +6,7 @@
     "build": "turbo build",
     "dev": "turbo dev",
     "clean": "turbo clean",
+    "bundlewatch": "turbo bundlewatch",
     "version": "changeset version",
     "publish": "changeset publish",
     "reformat-mdx": "node build/reformat-mdx.mjs"

+ 6 - 0
turbo.json

@@ -18,6 +18,12 @@
         "^clean"
       ],
       "cache": false
+    },
+    "bundlewatch": {
+      "dependsOn": [
+        "^bundlewatch",
+        "^build"
+      ]
     }
   }
 }