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

Config node module caching in ci workflow #86

Merged
merged 3 commits into from
Aug 24, 2023
Merged

Config node module caching in ci workflow #86

merged 3 commits into from
Aug 24, 2023

Conversation

mokhs00
Copy link
Member

@mokhs00 mokhs00 commented Aug 21, 2023

Close #67

Summary

@mokhs00 mokhs00 requested a review from Yaminyam August 21, 2023 17:12
@mokhs00 mokhs00 self-assigned this Aug 21, 2023
@korECM
Copy link
Member

korECM commented Aug 24, 2023

setup-node Action에서 기본적으로 cache 기능을 제공해주는 것으로 알고 있어서 별도로 필요한게 아니라면 setup-node 이용해서 캐싱하는 것도 좋을 것 같아요.

https://github.com/actions/setup-node#caching-global-packages-data
->
The action has a built-in functionality for caching and restoring dependencies. It uses actions/cache under the hood for caching global packages data but requires less configuration settings. Supported package managers are npm, yarn, pnpm (v6.10+). The cache input is optional, and caching is turned off by default.

steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
  with:
    node-version: 16
    cache: 'npm'
- run: npm ci
- run: npm test

@mokhs00
Copy link
Member Author

mokhs00 commented Aug 24, 2023

@korECM 아닛 이런 게 있다니.. 혼자 꿀빨고 계셨네요? ㅋㅋㅋㅋㅋ~

@mokhs00 mokhs00 requested a review from korECM August 24, 2023 10:57
@korECM
Copy link
Member

korECM commented Aug 24, 2023

@mokhs00
여담이지만 self-hosted runner를 사용하지 않아도 충분히 캐시 효과를 볼 수 있어요.

제가 생각하는 원인은 다음과 같은데 팩트 체크를 한 것은 아니라서 틀릴지도..?

  1. 패키지의 종속성 분석 및 컴파일 과정 없이 모듈 파일을 다운로드만 하면 되므로 빠름
  2. github action 캐시는 GitHub-owned cloud storage에 저장되는데 내부 구조는 모르지만 github의 runner 입장에서 npm registry보다 github storage에서 더 빠르게 받아올 수 있지 않을까..?
  3. 패키지 별로 따로 다운로드를 진행하는 것과 하나의 큰 파일을 받는 부분에서도 속도 차이가 발생할 것 같아요

@mokhs00 mokhs00 merged commit eb2466d into main Aug 24, 2023
1 check passed
@mokhs00 mokhs00 deleted the ISSUE-67 branch August 24, 2023 12:44
@Yaminyam
Copy link
Member

image 액션탭의 왼쪽에 메뉴바에서 캐시탭을 확인 할 수 있고 관리도 가능합니다. 최대 10기가까지 저장 가능하고 넘어가면 가장 오래 사용안된 캐시부터 자동으로 삭제됩니다

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.

workflow ci에서 node module 캐시 적용
3 participants