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

ci: Use built-in cache action #110

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jongwooo
Copy link

Description

Changed workflows to cache dependencies using actions/setup-node. setup-node@v2 or newer has caching built-in.

AS-IS

- name: Use Node.js ${{ matrix.node }}
  uses: actions/setup-node@v3
  with:
    node-version: ${{ matrix.node }}

- name: 'Cache node_modules'
  uses: actions/cache@v3
  with:
    path: '~/.npm'
    key: ${{ runner.os }}-node-v${{ matrix.node }}-integration-npm-210321-${{ hashFiles('**/package-lock.json') }} }}
    restore-keys: |
      ${{ runner.os }}-node-v${{ matrix.node }}-integration-npm-210321-

TO-BE

- name: Use Node.js ${{ matrix.node }}
  uses: actions/setup-node@v3
  with:
    node-version: ${{ matrix.node }}
    cache: npm

It’s literally a one line change to pass the cache: npm input parameter.

References

Signed-off-by: jongwooo <jongwooo.han@gmail.com>
@jongwooo jongwooo force-pushed the ci/use-built-in-cache-action branch from 57c47bd to b7d3435 Compare November 13, 2022 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant