Skip to content

Commit 516bb31

Browse files
authored
chore: skip installing on cache-hit
1 parent b9601a5 commit 516bb31

File tree

1 file changed

+35
-15
lines changed

1 file changed

+35
-15
lines changed

.github/workflows/checks.yml

Lines changed: 35 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,26 @@ jobs:
1818
steps:
1919
- name: Checkout
2020
uses: actions/checkout@v2
21-
- name: Cache node_modules
22-
uses: actions/cache@v2
23-
with:
24-
path: '**/node_modules'
25-
key: ${{ runner.os }}-${{ matrix.node-version }}-modules-${{ hashFiles('**/yarn.lock') }}
21+
2622
- name: Setup Node.js
2723
uses: actions/setup-node@v1
2824
with:
2925
node-version: ${{ matrix.node-version }}
26+
27+
- name: Cache node_modules
28+
uses: actions/cache@v2
29+
id: cache-nodemodules
30+
with:
31+
path: node_modules
32+
key: ${{ runner.os }}-${{ matrix.node-version }}-nodemodules-${{ hashFiles('**/yarn.lock') }}
33+
3034
- name: Install dependencies
35+
if: steps.cache-nodemodules.outputs.cache-hit != 'true'
3136
run: yarn install --frozen-lockfile --non-interactive
37+
3238
- name: Unit tests
3339
run: yarn test -- --ci
40+
3441
lint:
3542
name: Lint
3643
runs-on: ubuntu-latest
@@ -41,19 +48,26 @@ jobs:
4148
steps:
4249
- name: Checkout
4350
uses: actions/checkout@v2
44-
- name: Cache node_modules
45-
uses: actions/cache@v2
46-
with:
47-
path: '**/node_modules'
48-
key: ${{ runner.os }}-${{ matrix.node-version }}-modules-${{ hashFiles('**/yarn.lock') }}
51+
4952
- name: Setup Node.js
5053
uses: actions/setup-node@v1
5154
with:
5255
node-version: ${{ matrix.node-version }}
56+
57+
- name: Cache node_modules
58+
uses: actions/cache@v2
59+
id: cache-nodemodules
60+
with:
61+
path: node_modules
62+
key: ${{ runner.os }}-${{ matrix.node-version }}-nodemodules-${{ hashFiles('**/yarn.lock') }}
63+
5364
- name: Install dependencies
65+
if: steps.cache-nodemodules.outputs.cache-hit != 'true'
5466
run: yarn install --frozen-lockfile --non-interactive
67+
5568
- name: Lint
5669
run: yarn lint
70+
5771
website:
5872
name: Test build website
5973
if: ${{ github.event.issue.pull_request }}
@@ -65,16 +79,22 @@ jobs:
6579
steps:
6680
- name: Checkout
6781
uses: actions/checkout@v2
68-
- name: Cache node_modules
69-
uses: actions/cache@v2
70-
with:
71-
path: '**/node_modules'
72-
key: ${{ runner.os }}-${{ matrix.node-version }}-modules-${{ hashFiles('**/yarn.lock') }}
82+
7383
- name: Setup Node.js
7484
uses: actions/setup-node@v1
7585
with:
7686
node-version: ${{ matrix.node-version }}
87+
88+
- name: Cache node_modules
89+
uses: actions/cache@v2
90+
id: cache-nodemodules
91+
with:
92+
path: node_modules
93+
key: ${{ runner.os }}-${{ matrix.node-version }}-nodemodules-${{ hashFiles('**/yarn.lock') }}
94+
7795
- name: Install dependencies
96+
if: steps.cache-nodemodules.outputs.cache-hit != 'true'
7897
run: yarn install --frozen-lockfile --non-interactive
98+
7999
- name: Build website
80100
run: yarn website

0 commit comments

Comments
 (0)