Skip to content

Commit b3e318f

Browse files
author
jyn
committed
2 parents 75d8e33 + 1b15c59 commit b3e318f

File tree

6 files changed

+56
-7375
lines changed

6 files changed

+56
-7375
lines changed

.github/workflows/lighthouse-ci.yml

Lines changed: 41 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,19 @@ jobs:
3838
${{ runner.os }}-pnpm-store-
3939
4040
- name: Install dependencies
41-
run: pnpm install --frozen-lockfile
41+
run: pnpm install --no-frozen-lockfile
4242

4343
- name: Run Lighthouse CI
4444
run: pnpm lighthouse:ci
4545

46+
- name: Upload Lighthouse HTML reports
47+
uses: actions/upload-artifact@v4
48+
if: always()
49+
with:
50+
name: lighthouse-html-reports
51+
path: lighthouse-reports/
52+
retention-days: 30
53+
4654
- name: Upload Lighthouse results
4755
uses: actions/upload-artifact@v4
4856
if: always()
@@ -51,7 +59,7 @@ jobs:
5159
path: .lighthouseci/
5260
retention-days: 30
5361

54-
- name: Comment PR with Lighthouse results
62+
- name: Comment PR with Korean Lighthouse results
5563
if: github.event_name == 'pull_request'
5664
uses: actions/github-script@v7
5765
with:
@@ -64,19 +72,45 @@ jobs:
6472
if (fs.existsSync(resultsPath)) {
6573
const results = JSON.parse(fs.readFileSync(resultsPath, 'utf8'));
6674
67-
let comment = '## 🚀 Lighthouse CI Results\n\n';
75+
let comment = '## �� Lighthouse CI 성능 테스트 결과\n\n';
6876
6977
if (results.length === 0) {
70-
comment += '✅ All Lighthouse checks passed!\n';
78+
comment += '✅ 모든 Lighthouse 검사가 통과했습니다!\n';
7179
} else {
72-
comment += '⚠️ Some Lighthouse checks failed:\n\n';
80+
comment += '⚠️ 일부 Lighthouse 검사에서 문제가 발견되었습니다:\n\n';
81+
82+
// 한글 메시지 매핑
83+
const koreanMessages = {
84+
'largest-contentful-paint': '가장 큰 콘텐츠가 표시되는 시간 (LCP)',
85+
'first-contentful-paint': '첫 번째 콘텐츠가 표시되는 시간 (FCP)',
86+
'cumulative-layout-shift': '누적 레이아웃 이동 (CLS)',
87+
'total-blocking-time': '총 차단 시간 (TBT)',
88+
'categories:performance': '성능 점수',
89+
'categories:accessibility': '접근성 점수',
90+
'categories:seo': 'SEO 점수',
91+
'categories:best-practices': '모범 사례 점수'
92+
};
93+
7394
results.forEach(result => {
7495
const status = result.passed ? '✅' : '❌';
75-
comment += `${status} **${result.auditTitle}**: ${result.actual}ms (기준: ${result.expected}ms)\n`;
96+
const koreanTitle = koreanMessages[result.auditId] || result.auditTitle;
97+
const value = result.auditId.includes('categories:') ?
98+
`${(result.actual * 100).toFixed(0)}점` :
99+
`${result.actual}ms`;
100+
const expected = result.auditId.includes('categories:') ?
101+
`${(result.expected * 100).toFixed(0)}점 이상` :
102+
`${result.expected}ms 이하`;
103+
104+
comment += `${status} **${koreanTitle}**: ${value} (기준: ${expected})\n`;
76105
});
77106
}
78107
79-
comment += '\n📊 [View detailed report](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})';
108+
comment += '\n📊 [상세 보고서 다운로드](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})';
109+
comment += '\n\n�� **성능 개선 권장사항**:';
110+
comment += '\n- 이미지 최적화 (WebP 포맷, 적절한 크기)';
111+
comment += '\n- 폰트 사전 로드 및 최적화';
112+
comment += '\n- 중요 리소스 사전 로드';
113+
comment += '\n- CDN 사용 및 캐싱 개선';
80114
81115
github.rest.issues.createComment({
82116
issue_number: context.issue.number,

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
!.yarn/plugins
1010
!.yarn/releases
1111
!.yarn/versions
12+
package-lock.json
1213

1314
# testing
1415
/coverage

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# Nomadia
22

3-
노마디아
3+
노마디아 readme 추가 예정

lighthouserc.js

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,17 @@ module.exports = {
33
collect: {
44
// 실제 배포 URL 사용 (포트 충돌 방지)
55
url: ['https://nomadia-two.vercel.app/'],
6-
7-
// 또는 다른 포트 사용
8-
// startServerCommand: 'pnpm start --port 3001',
9-
// startServerReadyPattern: 'ready on',
10-
// url: ['http://localhost:3001'],
116
numberOfRuns: 3,
7+
// 한글 설정 및 HTML 보고서 생성
8+
settings: {
9+
locale: 'ko',
10+
output: 'html',
11+
outputPath: './lighthouse-reports',
12+
chromeFlags: '--no-sandbox --disable-dev-shm-usage',
13+
},
1214
},
1315
assert: {
14-
// 성능 기준 설정
16+
// 성능 기준 설정 (한글 메시지)
1517
assertions: {
1618
'categories:performance': ['warn', { minScore: 0.5 }],
1719
'categories:accessibility': ['error', { minScore: 0.5 }],
@@ -25,8 +27,9 @@ module.exports = {
2527
},
2628
},
2729
upload: {
28-
// 업로드 비활성화 (토큰 없이 로컬에서만 실행)
30+
// HTML 보고서를 GitHub Actions에서 업로드
2931
target: 'filesystem',
32+
outputDir: './lighthouse-reports',
3033
},
3134
},
3235
};

0 commit comments

Comments
 (0)