Yuki Takei пре 6 година
родитељ
комит
6249ac38eb
1 измењених фајлова са 37 додато и 11 уклоњено
  1. 37 11
      .github/workflows/ci.yml

+ 37 - 11
.github/workflows/ci.yml

@@ -27,8 +27,17 @@ jobs:
       with:
       with:
         path: node_modules
         path: node_modules
         key: ${{ runner.OS }}-node_modules-${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}
         key: ${{ runner.OS }}-node_modules-${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}
+    - name: Get yarn cache
+      if: steps.cache-dependencies.outputs.cache-hit != 'true'
+      id: cache-yarn
+      run: echo "::set-output name=dir::$(yarn cache dir)"
+    - uses: actions/cache@v1
+      if: steps.cache-dependencies.outputs.cache-hit != 'true'
+      with:
+        path: ${{ steps.cache-yarn.outputs.dir }}
+        key: ${{ runner.os }}-yarn-${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}
         restore-keys: |
         restore-keys: |
-          ${{ runner.OS }}-node_modules-${{ matrix.node-version }}-
+          ${{ runner.os }}-yarn-${{ matrix.node-version }}-
     - name: Install dependencies
     - name: Install dependencies
       if: steps.cache-dependencies.outputs.cache-hit != 'true'
       if: steps.cache-dependencies.outputs.cache-hit != 'true'
       run: |
       run: |
@@ -71,8 +80,17 @@ jobs:
       with:
       with:
         path: node_modules
         path: node_modules
         key: ${{ runner.OS }}-node_modules-${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}
         key: ${{ runner.OS }}-node_modules-${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}
+    - name: Get yarn cache
+      if: steps.cache-dependencies.outputs.cache-hit != 'true'
+      id: cache-yarn
+      run: echo "::set-output name=dir::$(yarn cache dir)"
+    - uses: actions/cache@v1
+      if: steps.cache-dependencies.outputs.cache-hit != 'true'
+      with:
+        path: ${{ steps.cache-yarn.outputs.dir }}
+        key: ${{ runner.os }}-yarn-${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}
         restore-keys: |
         restore-keys: |
-          ${{ runner.OS }}-node_modules-${{ matrix.node-version }}-
+          ${{ runner.os }}-yarn-${{ matrix.node-version }}-
     - name: Install dependencies
     - name: Install dependencies
       if: steps.cache-dependencies.outputs.cache-hit != 'true'
       if: steps.cache-dependencies.outputs.cache-hit != 'true'
       run: |
       run: |
@@ -121,8 +139,17 @@ jobs:
       with:
       with:
         path: node_modules
         path: node_modules
         key: ${{ runner.OS }}-node_modules-${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}
         key: ${{ runner.OS }}-node_modules-${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}
+    - name: Get yarn cache
+      if: steps.cache-dependencies.outputs.cache-hit != 'true'
+      id: cache-yarn
+      run: echo "::set-output name=dir::$(yarn cache dir)"
+    - uses: actions/cache@v1
+      if: steps.cache-dependencies.outputs.cache-hit != 'true'
+      with:
+        path: ${{ steps.cache-yarn.outputs.dir }}
+        key: ${{ runner.os }}-yarn-${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}
         restore-keys: |
         restore-keys: |
-          ${{ runner.OS }}-node_modules-${{ matrix.node-version }}-
+          ${{ runner.os }}-yarn-${{ matrix.node-version }}-
     - name: Install dependencies
     - name: Install dependencies
       if: steps.cache-dependencies.outputs.cache-hit != 'true'
       if: steps.cache-dependencies.outputs.cache-hit != 'true'
       run: |
       run: |
@@ -159,17 +186,16 @@ jobs:
       uses: actions/setup-node@v1
       uses: actions/setup-node@v1
       with:
       with:
         node-version: ${{ matrix.node-version }}
         node-version: ${{ matrix.node-version }}
-    - name: Cache/Restore node_modules
-      id: cache-dependencies
-      uses: actions/cache@v1
+    - name: Get yarn cache
+      id: cache-yarn
+      run: echo "::set-output name=dir::$(yarn cache dir)"
+    - uses: actions/cache@v1
       with:
       with:
-        path: node_modules
-        key: $GITHUB_SHA
+        path: ${{ steps.cache-yarn.outputs.dir }}
+        key: ${{ runner.os }}-yarn-${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}
         restore-keys: |
         restore-keys: |
-          ${{ runner.OS }}-node_modules-${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}
-          ${{ runner.OS }}-node_modules-${{ matrix.node-version }}-
+          ${{ runner.os }}-yarn-${{ matrix.node-version }}-
     - name: Install dependencies
     - name: Install dependencies
-      if: steps.cache-dependencies.outputs.cache-hit != 'true'
       run: |
       run: |
         yarn add growi-plugin-lsx growi-plugin-pukiwiki-like-linker growi-plugin-attachment-refs react-images react-motion
         yarn add growi-plugin-lsx growi-plugin-pukiwiki-like-linker growi-plugin-attachment-refs react-images react-motion
     - name: Print dependencies
     - name: Print dependencies