Skip to content
This repository was archived by the owner on Jan 2, 2022. It is now read-only.

Commit 21229be

Browse files
committed
ci: cache dependencies between runs
Signed-off-by: Jonah Snider <[email protected]>
1 parent 0aba876 commit 21229be

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

.github/workflows/ci.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,17 @@ jobs:
1717
node-version: '12.16.2'
1818
- name: Install Yarn
1919
run: curl -o- -L https://yarnpkg.com/install.sh | bash
20+
- name: Get yarn cache directory path
21+
id: yarn-cache-dir-path
22+
run: echo "::set-output name=dir::$(yarn cache dir)"
23+
- name: Cache dependencies
24+
uses: actions/cache@v1
25+
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
26+
with:
27+
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
28+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
29+
restore-keys: |
30+
${{ runner.os }}-yarn-
2031
- name: Install dependencies with Yarn
2132
run: yarn install
2233
- name: Compile TypeScript
@@ -40,6 +51,17 @@ jobs:
4051
node-version: '12.16.2'
4152
- name: Install Yarn
4253
run: curl -o- -L https://yarnpkg.com/install.sh | bash
54+
- name: Get yarn cache directory path
55+
id: yarn-cache-dir-path
56+
run: echo "::set-output name=dir::$(yarn cache dir)"
57+
- name: Cache dependencies
58+
uses: actions/cache@v1
59+
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
60+
with:
61+
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
62+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
63+
restore-keys: |
64+
${{ runner.os }}-yarn-
4365
- name: Install dependencies with Yarn
4466
run: yarn install
4567
- name: Lint with XO
@@ -58,6 +80,17 @@ jobs:
5880
node-version: '12.16.2'
5981
- name: Install Yarn
6082
run: curl -o- -L https://yarnpkg.com/install.sh | bash
83+
- name: Get yarn cache directory path
84+
id: yarn-cache-dir-path
85+
run: echo "::set-output name=dir::$(yarn cache dir)"
86+
- name: Cache dependencies
87+
uses: actions/cache@v1
88+
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
89+
with:
90+
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
91+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
92+
restore-keys: |
93+
${{ runner.os }}-yarn-
6194
- name: Install dependencies with Yarn
6295
run: yarn install
6396
- name: Check style with Prettier
@@ -78,6 +111,17 @@ jobs:
78111
node-version: '12.16.2'
79112
- name: Install Yarn
80113
run: curl -o- -L https://yarnpkg.com/install.sh | bash
114+
- name: Get yarn cache directory path
115+
id: yarn-cache-dir-path
116+
run: echo "::set-output name=dir::$(yarn cache dir)"
117+
- name: Cache dependencies
118+
uses: actions/cache@v1
119+
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
120+
with:
121+
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
122+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
123+
restore-keys: |
124+
${{ runner.os }}-yarn-
81125
- name: Install dependencies with Yarn
82126
run: yarn install
83127
- name: Compile TypeScript for publishing

0 commit comments

Comments
 (0)