Skip to content

Commit ff746e4

Browse files
committed
Enable caching of node installs even if they are failing
1 parent 5dcf6d3 commit ff746e4

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

.github/actions/build-node/action.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,18 +57,26 @@ runs:
5757
if: inputs.download_yarn_lock == 'true'
5858
with:
5959
name: node-yarn-lock
60-
# Enable yarn download cache, @see https://github.com/actions/setup-node/issues/325
60+
# Enable yarn download cache, @see https://github.com/actions/cache/tree/main/save#always-save-cache and https://github.com/actions/setup-node/issues/325
6161
- name: Restore yarn cache
62-
uses: actions/cache@v3
62+
uses: actions/cache/restore@v3
6363
with:
6464
# This path is the global yarn cache, because for some reason the local .yarn/cache is not used. Maybe we need to set the cacheFolder, enableGlobalCache, ... options differently? @see https://yarnpkg.com/configuration/yarnrc#cacheFolder
6565
path: ~/.yarn/berry/cache/
6666
key: yarn-download-cache-${{ hashFiles('package.json') }}
6767
restore-keys: |
6868
yarn-download-cache-
6969
- name: Install dependencies
70+
id: install
7071
run: yarn install --no-immutable --inline-builds
7172
shell: bash
73+
- name: Save yarn cache
74+
uses: actions/cache/save@v3
75+
if: steps.install.outcome == 'success'
76+
with:
77+
# This path is the global yarn cache, because for some reason the local .yarn/cache is not used. Maybe we need to set the cacheFolder, enableGlobalCache, ... options differently? @see https://yarnpkg.com/configuration/yarnrc#cacheFolder
78+
path: ~/.yarn/berry/cache/
79+
key: yarn-download-cache-${{ hashFiles('package.json') }}
7280
- name: Show installed dependencies
7381
run: yarn info --name-only
7482
shell: bash

0 commit comments

Comments
 (0)