Skip to content

ria-ahyoung/lighthouse-report-ci

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

18 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Lighthouse Report CI

LightHouse λ¦¬ν¬νŒ… κ²°κ³Όλ₯Ό λ°”νƒ•μœΌλ‘œ PR μ½”λ©˜νŠΈλ₯Ό μƒμ„±ν•΄μ£ΌλŠ” μžλ™ν™” μ½”λ“œμž…λ‹ˆλ‹€.

CI νŒŒμ΄ν”„λΌμΈμ— κ΅¬μΆ•ν•˜μ—¬ 전체 μ‚¬μ΄νŠΈ μ„±λŠ₯에 λ―ΈμΉ˜λŠ” 영ν–₯을 μžλ™μœΌλ‘œ λ¦¬ν¬νŒ…λ  수 μžˆλ„λ‘ μ μš©λ˜μ–΄ μžˆμŠ΅λ‹ˆλ‹€.

image

Result

  • ν”„λ‘œμ νŠΈμ—μ„œ Lighthouse CIλ₯Ό ν™œμš©ν•˜μ—¬ μ›Ή μ‚¬μ΄νŠΈμ˜ μ„±λŠ₯을 ν‰κ°€ν•˜κ³  μ‹€ν–‰λœ 결과의 평균값을 μ‚°μΆœν•©λ‹ˆλ‹€.

  • μ•„λž˜ μ˜ˆμ‹œλŠ” λ‹€μ„― 번 μ‹€ν–‰ν•œ 결과의 평균값에 λŒ€ν•œ λ³΄κ³ μ„œμž…λ‹ˆλ‹€. Lighthouse CI둜 ν†΅κ³„λœ κ²°κ³Όλ₯Ό ν¬λ§·νŒ…ν•œ λ‚΄μš©μž…λ‹ˆλ‹€.

image
  • 각 결과에 λŒ€ν•œ μ„ΈλΆ€ λ‚΄μš©μ€ ν‘œ ν˜•νƒœλ‘œ ν‘œμ‹œλ©λ‹ˆλ‹€.

    • Web Vitals Summary λŠ” μ›Ή μ‚¬μ΄νŠΈμ˜ 핡심 μ„±λŠ₯ μ§€ν‘œ
    • Categories Summary λŠ” μ„±λŠ₯, μ ‘κ·Όμ„±, μ΅œμ ν™”, SEO, PWA κ΄€λ ¨ ν•­λͺ©λ“€μ˜ 평가 점수λ₯Ό λ‚˜νƒ€λƒ…λ‹ˆλ‹€.
  • IS_SHOW_DETAIL κ°’ 섀정을 톡해 μ„ΈλΆ€ κ²°κ³Ό ν‘œκΈ°κ°€ κ°€λŠ₯ν•©λ‹ˆλ‹€.

    image
  • lighthouse μ„€μ • νŒŒμΌμ— λͺ…μ‹œλœ numberOfRuns 횟수만큼 μ‹€ν–‰ν•œ 데이터 κ²°κ³Όλ₯Ό μ§‘κ³„ν•˜μ—¬ λ°˜ν™˜ν•©λ‹ˆλ‹€.

Quick Start

  1. LHCI Token λ°œκΈ‰

    Set Secret Name :
      LHCI_GITHUB_APP_TOKEN
    
  2. Setup package.json scripts (in root)

    "scripts": {
      "start": "ν”„λ‘œμ νŠΈ 싀행에 ν•„μš”ν•œ script μž‘μ„±",
      "build": "ν”„λ‘œμ νŠΈ λΉŒλ“œμ— ν•„μš”ν•œ script μž‘μ„±",
    }
  3. Setup LightHouse config file (.lighthouserc.js)

    module.exports = {
      ci: {
        collect: {
          staticDistDir: './build',
          startServerCommand: 'yarn start',
          url: ['http://localhost:3000'],
          numberOfRuns: 3,                // LightHouse μ„±λŠ₯ μΈ‘μ • 횟수
        },
        // ...
      },
    };
  4. Modify Web Vitals Result Metrics

    export const WEB_VITALS_METRICS = [
      // 리포트 κ²°κ³Ό 쀑 μΆ”κ°€ ν˜Ήμ€ μ œκ±°ν•˜κ³  싢은 ν•­λͺ© μˆ˜μ •
      "first-contentful-paint",
      "first-meaningful-paint",
      "speed-index",
      "total-blocking-time",
      "largest-contentful-paint",
      "cumulative-layout-shift",
    ];

Reference

About

LightHouse Report CI pipeline πŸ“ƒ (generate PR comments based on reporting results)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published