@@ -91,13 +91,29 @@ jobs:
9191 with :
9292 persist-credentials : false
9393 - name : Use Node.js ${{ env.NODE_VERSION }}
94+ id : setup-node
9495 uses : actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
9596 with :
9697 node-version : ${{ env.NODE_VERSION }}
98+ cache : npm
99+ cache-dependency-path : |
100+ tools/doc/package-lock.json
101+ tools/eslint/package-lock.json
102+ tools/lint-md/package-lock.json
103+ - name : Cache ESLint results
104+ uses : actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
105+ env :
106+ # ESLint only invalidates its cache on config changes, so the key also
107+ # covers the custom rules and the files they read.
108+ cache-prefix : eslint-${{ runner.os }}-${{ steps.setup-node.outputs.node-version }}-${{ hashFiles('eslint.config.mjs', '*/eslint.config_partial.mjs', 'tools/eslint/*', 'tools/eslint-rules/**', 'doc/api/errors.md', 'doc/api/deprecations.md') }}
109+ with :
110+ path : .eslintcache
111+ key : ${{ env.cache-prefix }}-${{ github.sha }}
112+ restore-keys : ${{ env.cache-prefix }}-
97113 - name : Lint JavaScript files
98114 run : |
99115 set +e
100- NODE=$(command -v node) make lint-js
116+ NODE=$(command -v node) make lint-js ESLINT_CACHE_FLAGS='--cache --cache-strategy content'
101117 EXIT_CODE="$?"
102118 if [ "$EXIT_CODE" != "0" ]; then
103119 echo
@@ -127,7 +143,7 @@ jobs:
127143 - name : Lint markdown files
128144 run : |
129145 echo "::add-matcher::.github/workflows/remark-lint-problem-matcher.json"
130- NODE=$(command -v node) make lint-md
146+ NODE=$(command -v node) make lint-md ESLINT_CACHE_FLAGS='--cache --cache-strategy content'
131147 env :
132148 NODE_RELEASED_VERSIONS : ${{ steps.get-released-versions.outputs.NODE_RELEASED_VERSIONS }}
133149 lint-py :
0 commit comments