Skip to content

Commit d734753

Browse files
committed
try with actions/cache@v2
1 parent db5ba62 commit d734753

File tree

1 file changed

+19
-8
lines changed

1 file changed

+19
-8
lines changed

.github/workflows/main.yml

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,25 @@ name: CI
22

33
on: [push]
44

5+
env:
6+
NODE_VERSION: 12.x
7+
58
jobs:
69
install:
710
runs-on: ubuntu-latest
811

9-
strategy:
10-
matrix:
11-
node-version: [10.x]
12-
1312
steps:
1413
- uses: actions/checkout@v2
15-
- name: Use Node.js ${{ matrix.node-version }}
14+
- name: Use Node ${{ env.NODE_VERSION }}
1615
uses: actions/setup-node@v2
1716
with:
18-
node-version: ${{ matrix.node-version }}
17+
node-version: ${{ env.NODE_VERSION }}
18+
- uses: actions/cache@v2
19+
with:
20+
path: '**/node_modules'
21+
key: ${{ runner.os }}-${{ env.NODE_VERSION }}-modules-${{ hashFiles('**/yarn.lock') }}
1922
- name: Install dependencies
20-
run: |
21-
yarn
23+
run: yarn install --frozen-lockfile
2224
# - name: run lint
2325
# run: |
2426
# yarn lint
@@ -52,6 +54,10 @@ jobs:
5254
steps:
5355
- name: Running lint
5456
uses: actions/checkout@v2
57+
- uses: actions/cache@v2
58+
with:
59+
path: '**/node_modules'
60+
key: ${{ runner.os }}-${{ env.NODE_VERSION }}-modules-${{ hashFiles('**/yarn.lock') }}
5561
- name: Lint
5662
run: yarn lint
5763
env:
@@ -64,6 +70,11 @@ jobs:
6470
steps:
6571
- name: Running tests
6672
uses: actions/checkout@v2
73+
- uses: actions/cache@v2
74+
with:
75+
path: '**/node_modules'
76+
key: ${{ runner.os }}-${{ env.NODE_VERSION }}-modules-${{ hashFiles('**/yarn.lock') }}
77+
- name: Test
6778
- name: Test
6879
run: yarn test
6980
env:

0 commit comments

Comments
 (0)