Skip to content

Commit abf124e

Browse files
authored
build: cache dependencies in lint_changed_files workflow
Signed-off-by: Philipp Burckhardt <[email protected]>
1 parent e661213 commit abf124e

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

.github/workflows/lint_changed_files.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,21 @@ jobs:
7272
node-version: '20' # 'lts/*'
7373
timeout-minutes: 5
7474

75+
# Cache dependencies:
76+
- name: 'Cache dependencies'
77+
# Pin action to full length commit SHA
78+
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
79+
id: cache
80+
with:
81+
path: |
82+
${{ github.workspace }}/node_modules
83+
key: ${{ runner.os }}-node-${{ hashFiles('**/package.json') }}
84+
restore-keys: |
85+
${{ runner.os }}-node-
86+
7587
# Install dependencies (accounting for possible network failures, etc, when installing node module dependencies):
7688
- name: 'Install dependencies'
89+
if: steps.cache.outputs.cache-hit != 'true'
7790
run: |
7891
make install-node-modules || make install-node-modules || make install-node-modules
7992
timeout-minutes: 15

0 commit comments

Comments
 (0)