Skip to content

feat: lighthouse report on frontend PRs#1203

Merged
Alessandro100 merged 30 commits into
mainfrom
winningday/lighthouse-pr-check
Jun 6, 2025
Merged

feat: lighthouse report on frontend PRs#1203
Alessandro100 merged 30 commits into
mainfrom
winningday/lighthouse-pr-check

Conversation

@Alessandro100

@Alessandro100 Alessandro100 commented May 15, 2025

Copy link
Copy Markdown
Contributor

Summary:

Adding lighthouse performance check in frontend PRs

Expected behavior:

On frontend PRs, there should be a lighthouse check on key pages. Also provides the lighthouse report for each key page:

ex: https://storage.googleapis.com/lighthouse-infrastructure.appspot.com/reports/1748974253255-25918.report.html
This storage url is a temporary url

To Note

  • the lighthouse report runs once and can be slightly flaky for performance (running many times and averaging out would yield more consistent results but would take more time)
  • lighthouse has no throttling when running in CI, uses specs of CI machine
  • IMPORTANT: In this PR there is a lot of different types of reports, but the only one that will persist is the one shown in the screenshot below
  • Adds ~2 mins to the CI build

Improvements to future versions

  • Compare performance to production version

Please make sure these boxes are checked before submitting your pull request - thanks!

  • Run the unit tests with ./scripts/api-tests.sh to make sure you didn't break anything
  • Add or update any needed documentation to the repo
  • Format the title like "feat: [new feature short description]". Title must follow the Conventional Commit Specification(https://www.conventionalcommits.org/en/v1.0.0/).
  • Linked all relevant issues
  • Include screenshot(s) showing how this pull request works and fixes the issue(s)

image

@github-actions

Copy link
Copy Markdown

Preview Firebase Hosting URL: https://mobility-feeds-dev--pr-1203-xjaqi00l.web.app

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Device URL
desktop https://mobilitydatabase.org

Device URL
mobile https://mobilitydatabase.org

Device URL
desktop https://mobilitydatabase.org/feeds

Device URL
mobile https://mobilitydatabase.org/feeds

Not what you expected? Are your scores flaky? GitHub runners could be the cause.
Try running on Foo instead

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Device URL
desktop http://localhost:55300

Device URL
mobile http://localhost:55300

Device URL
desktop http://localhost:55300/feeds

Device URL
mobile http://localhost:55300/feeds

Not what you expected? Are your scores flaky? GitHub runners could be the cause.
Try running on Foo instead

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Device URL
desktop http://localhost:55300

Device URL
desktop http://localhost:55300/feeds

Device URL
desktop http://localhost:55300/feeds/gtfs/mdb-2126

Device URL
desktop http://localhost:55300/feeds/gtfs_rt/mdb-2585

Device URL
desktop http://localhost:55300/gbfs/gbfs-flamingo_porirua

Not what you expected? Are your scores flaky? GitHub runners could be the cause.
Try running on Foo instead

@github-actions

Copy link
Copy Markdown

🔍 Lighthouse Report Results\n

@github-actions

github-actions Bot commented May 16, 2025

Copy link
Copy Markdown

*Lighthouse ran on https://mobility-feeds-dev--pr-1203-nlp6ow3m.web.app/ * (Desktop)
⚡️ HTML Report Lighthouse report for the changes in this PR:

Performance Accessibility Best Practices SEO
🟢 94 🟢 100 🟢 100 🟢 100

*Lighthouse ran on https://mobility-feeds-dev--pr-1203-nlp6ow3m.web.app/feeds * (Desktop)
⚡️ HTML Report Lighthouse report for the changes in this PR:

Performance Accessibility Best Practices SEO
🟠 66 🟠 87 🟢 100 🟢 100

*Lighthouse ran on https://mobility-feeds-dev--pr-1203-nlp6ow3m.web.app/feeds/gtfs/mdb-2126 * (Desktop)
⚡️ HTML Report Lighthouse report for the changes in this PR:

Performance Accessibility Best Practices SEO
🟠 89 🔴 0 🟢 96 🟢 100

*Lighthouse ran on https://mobility-feeds-dev--pr-1203-nlp6ow3m.web.app/feeds/gtfs_rt/mdb-2585 * (Desktop)
⚡️ HTML Report Lighthouse report for the changes in this PR:

Performance Accessibility Best Practices SEO
🟢 95 🟠 88 🟢 100 🟢 100

*Lighthouse ran on https://mobility-feeds-dev--pr-1203-nlp6ow3m.web.app/gbfs/gbfs-flamingo_porirua * (Desktop)
⚡️ HTML Report Lighthouse report for the changes in this PR:

Performance Accessibility Best Practices SEO
🟢 100 🟢 100 🟢 100 🟢 100

@Alessandro100 Alessandro100 force-pushed the winningday/lighthouse-pr-check branch from 6be4156 to c6034bc Compare June 3, 2025 12:42
@github-actions

github-actions Bot commented Jun 3, 2025

Copy link
Copy Markdown

Preview Firebase Hosting URL: https://mobility-feeds-dev--pr-1203-nlp6ow3m.web.app

@Alessandro100 Alessandro100 force-pushed the winningday/lighthouse-pr-check branch from 8959c29 to f0b1493 Compare June 3, 2025 17:32
@Alessandro100 Alessandro100 self-assigned this Jun 3, 2025
@Alessandro100 Alessandro100 changed the title test light house github action feat: lighthouse report on frontend PRs Jun 3, 2025

@davidgamez davidgamez left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Amazing!



- name: Format lighthouse score
id: format_lighthouse_score

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

do we need: if: ${{ inputs.PREVIEW_DEPLOYMENT }} here?

core.setOutput("comment", finalComment);

- name: Add lighthouse comment to PR
id: comment_to_pr

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

do we need: if: ${{ inputs.PREVIEW_DEPLOYMENT }} here?

@Alessandro100 Alessandro100 requested a review from davidgamez June 4, 2025 12:43

@davidgamez davidgamez left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM! A cool PR!

@Alessandro100 Alessandro100 merged commit 963c7a2 into main Jun 6, 2025
6 checks passed
@Alessandro100 Alessandro100 deleted the winningday/lighthouse-pr-check branch June 6, 2025 13:20
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.

2 participants