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

chore: Use cache in ci.yml #377

Closed
wants to merge 1 commit into from
Closed

chore: Use cache in ci.yml #377

wants to merge 1 commit into from

Conversation

jongwooo
Copy link

Signed-off-by: jongwooo [email protected]

Details

Updated ci.yml to cache dependencies using actions/setup-node. setup-node@v3 or newer has caching built-in.

AS-IS

- name: Install Node.js 18
  uses: actions/setup-node@v3
  with:
    node-version: 18

- name: Install dependencies
  run: npm install

TO-BE

- name: Install Node.js 18
  uses: actions/setup-node@v3
  with:
    node-version: 18
    cache: npm

- name: Install dependencies
  run: npm ci

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

References

@simoneb
Copy link
Contributor

simoneb commented Dec 16, 2022

@jongwooo as you can see the workflows are failing because npm ci only works with a lockfile, which we don't have in this repo. @RafaelGSS any thoughts? Shall we add it so we can also enable this optimization or are we happy without?

@jongwooo
Copy link
Author

jongwooo commented Dec 16, 2022

@simoneb Oh, I forgot that there was no lockfile...!

@jongwooo
Copy link
Author

@jongwooo as you can see the workflows are failing because npm ci only works with a lockfile, which we don't have in this repo. @RafaelGSS any thoughts? Shall we add it so we can also enable this optimization or are we happy without?

If there is no plan to add a lockfile, I will close this PR.

@RafaelGSS
Copy link
Contributor

Usually, we don't use lockfiles on npm modules.

@jongwooo
Copy link
Author

jongwooo commented Dec 16, 2022

@simoneb Thank you for your careful comment! And @RafaelGSS, duly noted. Thank you! I will close this PR.

@jongwooo jongwooo closed this Dec 16, 2022
@jongwooo jongwooo deleted the chore/use-cache-in-workflow branch December 16, 2022 12:23
@RafaelGSS
Copy link
Contributor

Just to expand on that, see: sindresorhus/ama#479 (comment).

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.

3 participants