Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

input to cache global modules #4

Merged
merged 2 commits into from
Apr 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand All @@ -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:
Expand Down
6 changes: 6 additions & 0 deletions node-setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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 }}
Expand Down