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: 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 }}