From 87a493e24e2dd71a47e0564cd076546fd967fc06 Mon Sep 17 00:00:00 2001 From: Philipp Burckhardt Date: Fri, 7 Aug 2026 00:00:09 -0500 Subject: [PATCH] build: cache node modules to avoid repeated editorconfig-checker downloads --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown_pkg_readmes status: na - task: lint_markdown_docs status: na - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .github/workflows/lint_random_files.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/.github/workflows/lint_random_files.yml b/.github/workflows/lint_random_files.yml index 9208b7dd95ad..93755b1fc332 100644 --- a/.github/workflows/lint_random_files.yml +++ b/.github/workflows/lint_random_files.yml @@ -113,8 +113,21 @@ jobs: node-version: '20' # 'lts/*' timeout-minutes: 5 + # Restore cache if up-to-date: + - name: 'Restore cache if up-to-date' + # Pin action to full length commit SHA + uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 + id: cache + with: + path: | + ${{ github.workspace }}/node_modules + key: ${{ runner.os }}-node-${{ hashFiles('**/package.json') }} + restore-keys: | + ${{ runner.os }}-node- + # Install dependencies (accounting for possible network failures, etc, when installing node module dependencies): - name: 'Install dependencies' + if: steps.cache.outputs.cache-hit != 'true' run: | make install-node-modules || make install-node-modules || make install-node-modules timeout-minutes: 15 @@ -214,6 +227,14 @@ jobs: files=$(echo "$FILES" | tr ',' ' ') make lint-editorconfig-files FILES="${files}" 2>&1 | tee lint_editorconfig_errors.txt + # Save cache after editorconfig-checker binary has been downloaded: + - name: 'Save cache after editorconfig-checker binary has been downloaded' + if: always() && steps.cache.outputs.cache-hit != 'true' + uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 + with: + path: ${{ github.workspace }}/node_modules + key: ${{ steps.cache.outputs.cache-primary-key }} + # Create sub-issue for EditorConfig lint failures: - name: 'Create sub-issue for EditorConfig lint failures' if: failure() && contains(steps.lint-editorconfig.outcome, 'failure')