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

Add build job with turbo cache to CI #1615

Merged
merged 36 commits into from
Oct 17, 2023
Merged

Conversation

sungik-choi
Copy link
Contributor

@sungik-choi sungik-choi commented Sep 11, 2023

Self Checklist

  • I wrote a PR title in English and added an appropriate label to the PR.
  • I wrote the commit message in English and to follow the Conventional Commits specification.
  • I added the changeset about the changes that needed to be released. (or didn't have to)
  • I wrote or updated documentation related to the changes. (or didn't have to)
  • I wrote or updated tests related to the changes. (or didn't have to)
  • I tested the changes in various browsers. (or didn't have to)
    • Windows: Chrome, Edge, (Optional) Firefox
    • macOS: Chrome, Edge, Safari, (Optional) Firefox

Related Issue

Fixes #1005

Summary

  • 빌드 잡을 CI에 추가합니다.
  • 빌드 잡에 캐시를 추가합니다.

Details

기존에 --filter=bezier-icons 를 통해 아이콘 패키지만 빌드하던 것에서 필터를 제거하고, 모든 패키지를 빌드하도록 변경합니다. 의존성 업데이트 등 변경이 있었을 경우 라이브러리가 정상적으로 빌드되는 지 검증하기 위해서입니다. #1424 에서 빌드 시간이 많이 단축되었지만, 필터가 제거되었으므로 총 빌드 시간도 유의미하게 증가하게 될 거라 생각했습니다. 이를 방지하고자 빌드 잡에 캐시를 추가했습니다.

빌드 잡에 캐시 추가

  • 기존엔 jest의 캐시가 없었습니다. 캐시 관련 설정을 추가합니다.
    • 마이너: 캐시 설정을 추가하며 jest 설정을 레포지토리 전반적으로 통일합니다. jest 관련 패키지를 루트로 옮기고, @swc/jest 를 모든 패키지에 적용하여 테스트 수행시간을 줄이고자 했습니다. 기본값과 동일하거나 불필요한 jest 설정 옵션은 제거했습니다.
  • test:ci 스크립트를 제거하고 기존 test: jest --onlyChanged 스크립트를 test:ci 와 동일한 스크립트로 변경합니다. 기존에 only changed 플래그가 추가되었던 이유가 pre-commit 훅을 빠르게 수행하기 위해서였는데, pre-commit 훅이 제거되었기때문에 불필요해졌다고 판단했습니다.

Breaking change? (Yes/No)

No

@sungik-choi sungik-choi added the chore:system Issue or PR regarding source environment (e.g. lints, tests), not the actual source code label Sep 11, 2023
@sungik-choi sungik-choi self-assigned this Sep 11, 2023
@changeset-bot
Copy link

changeset-bot bot commented Sep 11, 2023

⚠️ No Changeset found

Latest commit: 76d7b6d

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions
Copy link
Contributor

github-actions bot commented Sep 11, 2023

Chromatic Report

🚀 Congratulations! Your build was successful!

@codecov
Copy link

codecov bot commented Sep 11, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (5042b04) 87.18% compared to head (76d7b6d) 87.18%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1615   +/-   ##
=======================================
  Coverage   87.18%   87.18%           
=======================================
  Files         281      281           
  Lines        3903     3903           
  Branches      821      821           
=======================================
  Hits         3403     3403           
  Misses        425      425           
  Partials       75       75           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

.github/workflows/ci.yml Outdated Show resolved Hide resolved
.github/workflows/chromatic.yml Outdated Show resolved Hide resolved
@sungik-choi
Copy link
Contributor Author

상술한 빌드 잡의 캐시를 워크플로우(CI, Chromatic, Release)간 공유, 전체적인 워크플로우 수행 시간을 단축시키기 위해 CI를 GitHub Actions로 이동했습니다. 같은 캐시 공간을 사용하기 때문에, 캐시 키(sha)만 동일하다면 캐시가 잘 히트될 것이라고 기대하고 있습니다.

-> 액션간 캐싱이 잘 동작하지 않아서, GitHub Actions으로 옮길 당위성이 부족하다고 판단, 고민중입니다. FYI. @yangwooseong

@sungik-choi sungik-choi marked this pull request as draft September 21, 2023 05:48
@sungik-choi sungik-choi changed the title Add build job with turbo cache to CI and move CI from CircleCI to GitHub Actions [WIP] Add build job with turbo cache to CI and move CI from CircleCI to GitHub Actions Sep 21, 2023
@sungik-choi sungik-choi marked this pull request as ready for review October 10, 2023 13:14
@sungik-choi
Copy link
Contributor Author

@sungik-choi sungik-choi changed the title [WIP] Add build job with turbo cache to CI and move CI from CircleCI to GitHub Actions Add build job with turbo cache to CI Oct 17, 2023
@sungik-choi sungik-choi marked this pull request as draft October 17, 2023 07:58
Copy link
Contributor Author

@sungik-choi sungik-choi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI. @yangwooseong

  • GitHub Actions로 옮길까 했으나, 저희 DevOps팀이 CircleCI를 사용하고 있으며 + GitHub Actions로 옮겼을 때 워크플로우간의 캐시 공유는 여전히 불가능하므로, 기존과 같이 CircleCI를 사용했습니다. 워크플로우간 & 다른 사람간 캐시 공유를 위해선 리모트 캐싱은 필수불가결한 거 같아요.
  • CircleCI orb(codecov)를 최신으로 업데이트했습니다.
  • machine resource를 기존 x-large가 과하다고 생각하여, large로 downgrade 해보려고 했으나 test 단계에서 리소스 문제로 뻗어버리더군요(SIGKILL).. 이 부분은 유지합니다

TODO

  • 빌드 캐시는 잘 동작하는 것을 확인했습니다!
  • 다만 lint, typecheck, test 캐시는 계속 miss하는 것으로 보아 현재 유의미하게 동작하는 거 같지 않아요. 테스트해보고, 불필요하다면 제거해도 괜찮을 거 같습니다.
image image

@sungik-choi sungik-choi marked this pull request as ready for review October 17, 2023 08:49

workflows:
version: 2
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

deprecated

Comment on lines -21 to -26
filter_only_tagged: &filter_only_tagged
filters:
tags:
only: /^v.*/
branches:
ignore: /.*/
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unused

@sungik-choi sungik-choi merged commit f3945b9 into channel-io:main Oct 17, 2023
6 checks passed
@sungik-choi sungik-choi deleted the ci/build branch October 17, 2023 09:01
@leejiwoo2002
Copy link
Contributor

데스크에서 turbo cache를 붙였다가 뗐었는데 이런 이슈가 있었어요 cc.@Kanary159357

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore:system Issue or PR regarding source environment (e.g. lints, tests), not the actual source code
Projects
No open projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Add build job to CI and improve build time
3 participants