Skip to content

Commit 085ab07

Browse files
ci: simplify yarn caching (#2154)
1 parent 035b0e9 commit 085ab07

File tree

1 file changed

+8
-27
lines changed

1 file changed

+8
-27
lines changed

.github/workflows/ci.yml

Lines changed: 8 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -41,23 +41,11 @@ jobs:
4141
steps:
4242
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
4343

44-
- uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516
44+
- name: Setup nodejs
45+
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516
4546
with:
46-
node-version: "12"
47-
48-
# https://github.com/actions/cache/blob/main/examples.md#node---yarn
49-
- name: Get yarn cache directory path
50-
id: yarn-cache-dir-path
51-
run: echo "::set-output name=dir::$(yarn cache dir)"
52-
53-
- name: Cache yarn
54-
uses: actions/cache@9b0c1fce7a93df8e3bb8926b0d6e9d89e92f20a7
55-
id: yarn-cache
56-
with:
57-
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
58-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
59-
restore-keys: |
60-
${{ runner.os }}-yarn-
47+
node-version: 16
48+
cache: "yarn"
6149

6250
- name: Install dependencies
6351
run: yarn install
@@ -136,18 +124,11 @@ jobs:
136124
steps:
137125
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
138126

139-
- name: Get yarn cache directory path
140-
id: yarn-cache-dir-path
141-
run: echo "::set-output name=dir::$(yarn cache dir)"
142-
143-
- name: Cache yarn
144-
uses: actions/cache@9b0c1fce7a93df8e3bb8926b0d6e9d89e92f20a7
145-
id: yarn-cache
127+
- name: Setup nodejs
128+
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516
146129
with:
147-
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
148-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
149-
restore-keys: |
150-
${{ runner.os }}-yarn-
130+
node-version: 16
131+
cache: "yarn"
151132

152133
- name: Install dependencies
153134
run: yarn install

0 commit comments

Comments
 (0)