@@ -93,13 +93,29 @@ jobs:
9393 with :
9494 persist-credentials : false
9595 - name : Use Node.js ${{ env.NODE_VERSION }}
96+ id : setup-node
9697 uses : actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
9798 with :
9899 node-version : ${{ env.NODE_VERSION }}
100+ cache : npm
101+ cache-dependency-path : |
102+ tools/doc/package-lock.json
103+ tools/eslint/package-lock.json
104+ tools/lint-md/package-lock.json
105+ - name : Cache ESLint results
106+ uses : actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
107+ env :
108+ # ESLint only invalidates its cache on config changes, so the key also
109+ # covers the custom rules and the files they read.
110+ 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') }}
111+ with :
112+ path : .eslintcache
113+ key : ${{ env.cache-prefix }}-${{ github.sha }}
114+ restore-keys : ${{ env.cache-prefix }}-
99115 - name : Lint JavaScript files
100116 run : |
101117 set +e
102- NODE=$(command -v node) make lint-js
118+ NODE=$(command -v node) make lint-js ESLINT_CACHE_FLAGS='--cache --cache-strategy content'
103119 EXIT_CODE="$?"
104120 if [ "$EXIT_CODE" != "0" ]; then
105121 echo
@@ -129,7 +145,7 @@ jobs:
129145 - name : Lint markdown files
130146 run : |
131147 echo "::add-matcher::.github/workflows/remark-lint-problem-matcher.json"
132- NODE=$(command -v node) make lint-md
148+ NODE=$(command -v node) make lint-md ESLINT_CACHE_FLAGS='--cache --cache-strategy content'
133149 env :
134150 NODE_RELEASED_VERSIONS : ${{ steps.get-released-versions.outputs.NODE_RELEASED_VERSIONS }}
135151
0 commit comments