mirror of
https://github.com/nodejs/node.git
synced 2026-11-21 12:59:16 -05:00
tools: add cache to lint-js-and-md
Signed-off-by: Antoine du Hamel <duhamelantoine1995@gmail.com> PR-URL: https://github.com/nodejs/node/pull/66412 Refs: https://github.com/nodejs/node/issues/64972 Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Mike McCready <66998419+MikeMcC399@users.noreply.github.com>
This commit is contained in:
1 parent
52b68e01a0
commit
253ebd2429
2 files changed
+20
-4
No files matched your search
@@ -93,13 +93,29 @@ jobs:
|
||||
with:
|
||||
persist-credentials: false
|
||||
- name: Use Node.js ${{ env.NODE_VERSION }}
|
||||
id: setup-node
|
||||
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
|
||||
with:
|
||||
node-version: ${{ env.NODE_VERSION }}
|
||||
cache: npm
|
||||
cache-dependency-path: |
|
||||
tools/doc/package-lock.json
|
||||
tools/eslint/package-lock.json
|
||||
tools/lint-md/package-lock.json
|
||||
- name: Cache ESLint results
|
||||
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
|
||||
env:
|
||||
# ESLint only invalidates its cache on config changes, so the key also
|
||||
# covers the custom rules and the files they read.
|
||||
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') }}
|
||||
with:
|
||||
path: .eslintcache
|
||||
key: ${{ env.cache-prefix }}-${{ github.sha }}
|
||||
restore-keys: ${{ env.cache-prefix }}-
|
||||
- name: Lint JavaScript files
|
||||
run: |
|
||||
set +e
|
||||
NODE=$(command -v node) make lint-js
|
||||
NODE=$(command -v node) make lint-js ESLINT_CACHE_FLAGS='--cache --cache-strategy content'
|
||||
EXIT_CODE="$?"
|
||||
if [ "$EXIT_CODE" != "0" ]; then
|
||||
echo
|
||||
@@ -129,7 +145,7 @@ jobs:
|
||||
- name: Lint markdown files
|
||||
run: |
|
||||
echo "::add-matcher::.github/workflows/remark-lint-problem-matcher.json"
|
||||
NODE=$(command -v node) make lint-md
|
||||
NODE=$(command -v node) make lint-md ESLINT_CACHE_FLAGS='--cache --cache-strategy content'
|
||||
env:
|
||||
NODE_RELEASED_VERSIONS: ${{ steps.get-released-versions.outputs.NODE_RELEASED_VERSIONS }}
|
||||
|
||||
|
||||
Reference in new issue
Block a user