-
Notifications
You must be signed in to change notification settings - Fork 0
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
SP-668 페이지별 성능 측정 tool(LightHouse) 자동화 환경 구축 #349
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SungHyun627
changed the title
Feat/sp 668 setup lighthouse ci
[SP-668] 페이지별 성능 측정 tool(LightHouse) 자동화 환경 구축
Jul 31, 2024
SungHyun627
temporarily deployed
to
github-pages
August 20, 2024 05:10 — with
GitHub Actions
Inactive
SungHyun627
temporarily deployed
to
github-pages
August 20, 2024 05:17 — with
GitHub Actions
Inactive
SungHyun627
temporarily deployed
to
github-pages
August 20, 2024 05:22 — with
GitHub Actions
Inactive
SungHyun627
temporarily deployed
to
github-pages
August 20, 2024 05:34 — with
GitHub Actions
Inactive
SungHyun627
temporarily deployed
to
github-pages
August 20, 2024 05:42 — with
GitHub Actions
Inactive
SungHyun627
temporarily deployed
to
github-pages
August 20, 2024 05:48 — with
GitHub Actions
Inactive
SungHyun627
temporarily deployed
to
github-pages
August 20, 2024 05:57 — with
GitHub Actions
Inactive
💡 LightHouse Reports🟢 90 ~ 100 🟠 50 ~ 89 🔴 0 ~ 49🖥 Desktop📄 메인
📄 로그인
📄 모집공고 모아보기
📄 모집공고 상세
📱 Mobile📄 메인
📄 로그인
📄 모집공고 모아보기
📄 모집공고 상세
|
SungHyun627
temporarily deployed
to
github-pages
August 20, 2024 06:09 — with
GitHub Actions
Inactive
SungHyun627
temporarily deployed
to
github-pages
August 20, 2024 06:15 — with
GitHub Actions
Inactive
SungHyun627
temporarily deployed
to
github-pages
August 20, 2024 06:30 — with
GitHub Actions
Inactive
SungHyun627
temporarily deployed
to
github-pages
August 20, 2024 08:09 — with
GitHub Actions
Inactive
abiriadev
requested changes
Aug 20, 2024
SungHyun627
temporarily deployed
to
github-pages
August 20, 2024 12:43 — with
GitHub Actions
Inactive
SungHyun627
changed the title
[SP-668] 페이지별 성능 측정 tool(LightHouse) 자동화 환경 구축
SP-668 페이지별 성능 측정 tool(LightHouse) 자동화 환경 구축
Aug 30, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #348
💡 다음 이슈를 해결했어요.
💡 이슈를 처리하면서 추가된 코드가 있어요.
🛠 lighthouse CI에 사용되는 상수 정의
lighthouse 성능 측정을 진행할 페이지, 페이지 라우트, 성능 점수 기준 등을 정의하였습니다.
ludo-frontend/src/Constants/lighthouse.ts
Lines 1 to 26 in 60637b4
🛠 lighthouse ci configuration 설정
처음에는 root에
lighthouserc.cjs
를 구성하고lighthouse autorun
명령어를 통해 lighthouse report를 생성하려고 했으나 device가 mobile일 때와 desktop일때를 분리하여 지표를 측정하는 게 필요하다고 생각하여 configuration을lighthouserc-mobile.cjs
와lighthouserc-desktop.cjs
로 나누어서 작성하였습니다.✔︎ Desktop configuration
ludo-frontend/lighthouserc-desktop.cjs
Lines 1 to 26 in 60637b4
✔︎ Mobile configuration
ludo-frontend/lighthouserc-mobile.cjs
Lines 1 to 25 in 60637b4
이를 기반으로 로컬에서
lhci collect --config=lighthouserc-desktop.cjs && lhci upload --config=lighthouserc-desktop.cjs
,lhci upload --config=lighthouserc-desktop.cjs && lhci collect --config=lighthouserc-desktop.cjs
를 실행하면 아래와 같이lhci_reports
폴더 하위에 각각의 device에 해당하는 폴더가 만들어지고, 그곳에 report가 생성됩니다.🛠 lighthouse workflow 작성
생성된 Report와 정의한 상수를 기반으로 lighthouse workflow를 작성하였습니다.
✔︎ 환경 설정 및 report 생성
ludo-frontend/.github/workflows/lighthouse.yml
Lines 1 to 49 in 60637b4
lhci_reports
폴더 하위에 lighthouse report가 생성되도록 하였습니다.✔︎ 성능 지표 포맷팅
ludo-frontend/.github/workflows/lighthouse.yml
Lines 52 to 129 in 60637b4
lhci_reports
폴더에 있는 report를 가져와 테이블 형식으로 성능 지표를 포맷팅 하였습니다.Comment PR
step에 사용하기 위해, step의 마지막에core.setOutput('comments', comment)
를 작성하였습니다.✔︎ PR Comment에 반영
ludo-frontend/.github/workflows/lighthouse.yml
Lines 131 to 166 in 60637b4
${{ steps.format_lighthouse_score.outputs.comments }}
로 가져와서 PR에 반영하였습니다.@octokit/rest
모듈을 활용하여 기존에 작성한 Comment 리스트를 불러와 기존에 작성한 Lighthouse Report Comment가 있다면 업데이트하고, 없다면 새로 작성하는 방식으로 PR Comment를 반영하였습니다.🎬 반영된 PR Comment
🎬 페이지별 지표
💡 필요한 후속작업이 있어요.
구축된 페이지별 성능 측정 자동화 환경을 기반으로, 성능 개선 작업 진행하겠습니다
💡 다음 자료를 참고하면 좋아요.
✅ 셀프 체크리스트