From 40c4a99d5e4ffcf7d6a975d8100b41ace04aeb19 Mon Sep 17 00:00:00 2001 From: Yehonal Date: Fri, 7 Apr 2023 13:15:53 +0200 Subject: [PATCH 1/2] input to cache global modules --- node-setup/action.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/node-setup/action.yml b/node-setup/action.yml index d720368..63fdb5b 100644 --- a/node-setup/action.yml +++ b/node-setup/action.yml @@ -36,6 +36,11 @@ inputs: description: 'Enable/disable caching of the local node_modules folder' required: false type: boolean + cache_global_npm_modules: + description: 'Enable/disable caching of the global node_modules folder' + required: false + type: boolean + default: true runs: using: 'composite' steps: @@ -51,6 +56,7 @@ runs: - name: Cache global npm uses: actions/cache@v3 + if: ( inputs.cache_global_npm_modules ) env: cache-name: cache-${{ inputs.project_id }}-global-node-modules NODE_MODULE_DIR: ${{ inputs.package_json_dir || github.workspace }} From 6d7f38e739ed5c4804411a5c4021d77d71b569f6 Mon Sep 17 00:00:00 2001 From: Yehonal Date: Fri, 7 Apr 2023 13:17:50 +0200 Subject: [PATCH 2/2] update --- .github/workflows/test.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f3afa55..0bc1091 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -17,6 +17,7 @@ jobs: npm_version: ${{ env.NPM_VERSION }} node_version: ${{ env.NODE_VERSION }} install_command: 'npm ci' + cache_global_modules: false uses: ./extra-info test-extra-info-remote-usage: @@ -28,6 +29,7 @@ jobs: node_version: ${{ env.NODE_VERSION }} package_json_path: ../package.json install_command: 'npm ci' + cache_global_modules: false uses: Drassil/gh-actions-collection/extra-info@master test-node-setup: @@ -41,6 +43,7 @@ jobs: project_id: 'test-node-setup' install_command: 'npm install' cache_npm_modules: true + cache_global_modules: false uses: ./node-setup test-node-setup-default-values: