소스 검색

Refactor bundlewatch workflow to use Turbo (#2119)

Paweł Kuna 7 달 전
부모
커밋
a370919ebe
5개의 변경된 파일28개의 추가작업 그리고 5개의 파일을 삭제
  1. 4 0
      .changeset/metal-carrots-battle.md
  2. 8 3
      .github/workflows/bundlewatch.yml
  3. 9 2
      .github/workflows/test.yml
  4. 1 0
      package.json
  5. 6 0
      turbo.json

+ 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
       - name: Clone repository
         uses: actions/checkout@v4
         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
       - name: Set up Node.js
         uses: actions/setup-node@v4
         uses: actions/setup-node@v4
         with:
         with:
@@ -36,9 +44,6 @@ jobs:
       - name: Install pnpm dependencies
       - name: Install pnpm dependencies
         run: pnpm install --no-frozen-lockfile
         run: pnpm install --no-frozen-lockfile
 
 
-      - name: Run build
-        run: pnpm run build
-
       - name: Run bundlewatch
       - name: Run bundlewatch
         run: pnpm run bundlewatch
         run: pnpm run bundlewatch
         env:
         env:

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

@@ -1,8 +1,7 @@
 name: Test build
 name: Test build
 
 
 on:
 on:
-  pull_request:
-    types: [ opened, reopened ]
+  pull_request: null
 
 
 env:
 env:
   NODE: 20
   NODE: 20
@@ -17,6 +16,14 @@ jobs:
       - name: Clone repository
       - name: Clone repository
         uses: actions/checkout@v4
         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
       - name: Set up Node.js
         uses: actions/setup-node@v4
         uses: actions/setup-node@v4
         with:
         with:

+ 1 - 0
package.json

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

+ 6 - 0
turbo.json

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