Browse Source

add checkout step

Yuki Takei 6 years ago
parent
commit
1ddab90182
1 changed files with 31 additions and 11 deletions
  1. 31 11
      .github/workflows/test.yml

+ 31 - 11
.github/workflows/test.yml

@@ -24,7 +24,7 @@ jobs:
       uses: actions/cache@v1
       uses: actions/cache@v1
       with:
       with:
         path: node_modules
         path: node_modules
-        key: ${{ runner.OS }}-node_modules-${{ hashFiles('**/yarn.lock') }}
+        key: ${{ runner.OS }}-node_modules-${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}
     - name: install dependencies
     - name: install dependencies
       run: |
       run: |
         yarn
         yarn
@@ -43,12 +43,17 @@ jobs:
     runs-on: ubuntu-latest
     runs-on: ubuntu-latest
     needs: resolve-dependencies
     needs: resolve-dependencies
 
 
+    strategy:
+      matrix:
+        node-version: [10.x, 12.x]
+
     steps:
     steps:
+    - uses: actions/checkout@v1
     - name: Cache/Restore node_modules
     - name: Cache/Restore node_modules
       uses: actions/cache@v1
       uses: actions/cache@v1
       with:
       with:
         path: node_modules
         path: node_modules
-        key: ${{ runner.OS }}-node_modules-${{ hashFiles('**/yarn.lock') }}
+        key: ${{ runner.OS }}-node_modules-${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}
     - uses: actions/checkout@v1
     - uses: actions/checkout@v1
     - name: yarn lint
     - name: yarn lint
       run: |
       run: |
@@ -59,16 +64,21 @@ jobs:
     runs-on: ubuntu-latest
     runs-on: ubuntu-latest
     needs: resolve-dependencies
     needs: resolve-dependencies
 
 
+    strategy:
+      matrix:
+        node-version: [10.x, 12.x]
+
     steps:
     steps:
-    - name: Launch MongoDB
-      uses: wbari/start-mongoDB@v0.2
-      with:
-        mongoDBVersion: 3.6
+    - uses: actions/checkout@v1
     - name: Cache/Restore node_modules
     - name: Cache/Restore node_modules
       uses: actions/cache@v1
       uses: actions/cache@v1
       with:
       with:
         path: node_modules
         path: node_modules
-        key: ${{ runner.OS }}-node_modules-${{ hashFiles('**/yarn.lock') }}
+        key: ${{ runner.OS }}-node_modules-${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}
+    - name: Launch MongoDB
+      uses: wbari/start-mongoDB@v0.2
+      with:
+        mongoDBVersion: 3.6
     - name: yarn test
     - name: yarn test
       run: |
       run: |
         yarn test
         yarn test
@@ -80,12 +90,17 @@ jobs:
     runs-on: ubuntu-latest
     runs-on: ubuntu-latest
     needs: resolve-dependencies
     needs: resolve-dependencies
 
 
+    strategy:
+      matrix:
+        node-version: [10.x, 12.x]
+
     steps:
     steps:
+    - uses: actions/checkout@v1
     - name: Cache/Restore node_modules
     - name: Cache/Restore node_modules
       uses: actions/cache@v1
       uses: actions/cache@v1
       with:
       with:
         path: node_modules
         path: node_modules
-        key: ${{ runner.OS }}-node_modules-${{ hashFiles('**/yarn.lock') }}
+        key: ${{ runner.OS }}-node_modules-${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}
     - name: yarn build:dev
     - name: yarn build:dev
       run: |
       run: |
         yarn build:dev
         yarn build:dev
@@ -95,7 +110,12 @@ jobs:
     runs-on: ubuntu-latest
     runs-on: ubuntu-latest
     needs: resolve-dependencies
     needs: resolve-dependencies
 
 
+    strategy:
+      matrix:
+        node-version: [10.x, 12.x]
+
     steps:
     steps:
+    - uses: actions/checkout@v1
     - name: Launch MongoDB
     - name: Launch MongoDB
       uses: wbari/start-mongoDB@v0.2
       uses: wbari/start-mongoDB@v0.2
       with:
       with:
@@ -104,10 +124,10 @@ jobs:
       uses: actions/cache@v1
       uses: actions/cache@v1
       with:
       with:
         path: node_modules
         path: node_modules
-        key: ${{ runner.OS }}-node_modules-${{ hashFiles('**/yarn.lock') }}-build-prod
+        key: ${{ runner.OS }}-node_modules-${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}-build-prod
         restore-keys: |
         restore-keys: |
-          ${{ runner.OS }}-node_modules-${{ hashFiles('**/yarn.lock') }}
-          ${{ runner.OS }}-node_modules-${{ hashFiles('**/yarn.lock') }}-build-prod
+          ${{ runner.OS }}-node_modules-${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}
+          ${{ runner.OS }}-node_modules-${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}-build-prod
     - name: yarn build:prod:analyze
     - name: yarn build:prod:analyze
       run: |
       run: |
         yarn build:prod:analyze
         yarn build:prod:analyze