瀏覽代碼

chore: Cache node_modules dirs for CI

Michael Bromley 4 年之前
父節點
當前提交
6454afbf44
共有 2 個文件被更改,包括 16 次插入4 次删除
  1. 12 3
      .github/workflows/build_and_test.yml
  2. 4 1
      .github/workflows/publish_and_install.yml

+ 12 - 3
.github/workflows/build_and_test.yml

@@ -31,7 +31,10 @@ jobs:
     - uses: actions/cache@v2
     - uses: actions/cache@v2
       id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
       id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
       with:
       with:
-        path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
+        path: |
+          node_modules
+          packages/*/node_modules
+          ${{ steps.yarn-cache-dir-path.outputs.dir }}
         key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
         key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
         restore-keys: |
         restore-keys: |
           ${{ runner.os }}-yarn-
           ${{ runner.os }}-yarn-
@@ -55,7 +58,10 @@ jobs:
       - uses: actions/cache@v2
       - uses: actions/cache@v2
         id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
         id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
         with:
         with:
-          path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
+          path: |
+            node_modules
+            packages/*/node_modules
+            ${{ steps.yarn-cache-dir-path.outputs.dir }}
           key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
           key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
           restore-keys: |
           restore-keys: |
             ${{ runner.os }}-yarn-
             ${{ runner.os }}-yarn-
@@ -124,7 +130,10 @@ jobs:
       - uses: actions/cache@v2
       - uses: actions/cache@v2
         id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
         id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
         with:
         with:
-          path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
+          path: |
+            node_modules
+            packages/*/node_modules
+            ${{ steps.yarn-cache-dir-path.outputs.dir }}
           key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
           key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
           restore-keys: |
           restore-keys: |
             ${{ runner.os }}-yarn-
             ${{ runner.os }}-yarn-

+ 4 - 1
.github/workflows/publish_and_install.yml

@@ -48,7 +48,10 @@ jobs:
     - uses: actions/cache@v2
     - uses: actions/cache@v2
       id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
       id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
       with:
       with:
-        path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
+        path: |
+          node_modules
+          packages/*/node_modules
+          ${{ steps.yarn-cache-dir-path.outputs.dir }}
         key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
         key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
         restore-keys: |
         restore-keys: |
           ${{ runner.os }}-yarn-
           ${{ runner.os }}-yarn-