|
7 | 7 | branches: [ master ]
|
8 | 8 |
|
9 | 9 | jobs:
|
10 |
| - build-and-test: |
| 10 | + build: |
| 11 | + name: Build |
11 | 12 | runs-on: ubuntu-latest
|
12 | 13 |
|
13 | 14 | steps:
|
14 | 15 | - name: checkout
|
15 | 16 | uses: actions/checkout@v2
|
16 | 17 |
|
17 |
| -# - name: Cache node modules |
18 |
| -# uses: actions/cache@v1 |
19 |
| -# id: cache |
20 |
| -# with: |
21 |
| -# path: node_modules |
22 |
| -# key: node-modules-${{ hashFiles('**/yarn.lock') }} |
| 18 | + - name: Cache node modules |
| 19 | + uses: actions/cache@v1 |
| 20 | + id: cache |
| 21 | + with: |
| 22 | + path: node_modules |
| 23 | + key: node-modules-${{ hashFiles('yarn.lock') }} |
23 | 24 |
|
24 | 25 | - name: Instal dependencies
|
25 |
| -# if: steps.cache.outputs.cache-hit != 'true' |
26 |
| - run: | |
27 |
| - yarn install --frozen-lockfile |
28 |
| - yarn install --frozen-lockfile --cwd ./website |
29 |
| - yarn install --frozen-lockfile --cwd ./example |
| 26 | + if: steps.cache.outputs.cache-hit != 'true' |
| 27 | + run: yarn install --frozen-lockfile |
| 28 | + |
| 29 | + - name: Cache node modules @ example |
| 30 | + uses: actions/cache@v1 |
| 31 | + id: cache-example |
| 32 | + with: |
| 33 | + path: ./example/node_modules |
| 34 | + key: node-modules-example--${{ hashFiles('example/yarn.lock') }} |
| 35 | + |
| 36 | + - name: Instal dependencies @ example |
| 37 | + if: steps.cache-example.outputs.cache-hit != 'true' |
| 38 | + run: yarn install --frozen-lockfile --cwd ./example |
| 39 | + |
| 40 | + - name: Cache node modules @ website |
| 41 | + uses: actions/cache@v1 |
| 42 | + id: cache-website |
| 43 | + with: |
| 44 | + path: ./website/node_modules |
| 45 | + key: node-modules-website-${{ hashFiles('website/yarn.lock') }} |
| 46 | + |
| 47 | + - name: Instal dependencies @ website |
| 48 | + if: steps.cache-website.outputs.cache-hit != 'true' |
| 49 | + run: yarn install --frozen-lockfile --cwd ./website |
| 50 | + |
| 51 | + test: |
| 52 | + needs: build |
| 53 | + name: Run tests |
| 54 | + runs-on: ubuntu-latest |
| 55 | + |
| 56 | + steps: |
| 57 | + - name: checkout |
| 58 | + uses: actions/checkout@v2 |
| 59 | + |
| 60 | + - name: Cache node modules |
| 61 | + uses: actions/cache@v1 |
| 62 | + id: cache |
| 63 | + with: |
| 64 | + path: node_modules |
| 65 | + key: node-modules-${{ hashFiles('yarn.lock') }} |
| 66 | + |
| 67 | + - name: Cache node modules @ website |
| 68 | + uses: actions/cache@v1 |
| 69 | + id: cache-website |
| 70 | + with: |
| 71 | + path: ./website/node_modules |
| 72 | + key: node-modules-website-${{ hashFiles('website/yarn.lock') }} |
| 73 | + |
| 74 | + - name: Cache node modules @ example |
| 75 | + uses: actions/cache@v1 |
| 76 | + id: cache-example |
| 77 | + with: |
| 78 | + path: ./example/node_modules |
| 79 | + key: node-modules-example--${{ hashFiles('example/yarn.lock') }} |
30 | 80 |
|
31 | 81 | - name: Run tests
|
32 | 82 | run: |
|
|
0 commit comments