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

added google's Lighthouse CI check #1275

Closed
wants to merge 16 commits into from
Closed

added google's Lighthouse CI check #1275

wants to merge 16 commits into from

Conversation

BhuwanChandra
Copy link
Contributor

Description of changes

added lighthouse ci check to get a measurement on the performance of website.

Issue Resolved

Fixes #1230

@vercel
Copy link

vercel bot commented Oct 6, 2020

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployments, click below or on the icon next to each commit.

storybook – ./

🔍 Inspect: https://vercel.com/operation-code/storybook/p4gavenvr
✅ Preview: https://storybook-git-lighthouse-ci.operation-code.vercel.app

operation-code – ./

🔍 Inspect: https://vercel.com/operation-code/operation-code/iphj0jsdq
✅ Preview: https://operation-code-git-lighthouse-ci.operation-code.now.sh

@cypress
Copy link

cypress bot commented Oct 6, 2020



Test summary

80 0 0 0Flakiness 1


Run details

Project operation_code
Status Passed
Commit 173e8e0
Started Oct 30, 2020 10:11 PM
Ended Oct 30, 2020 10:14 PM
Duration 02:27 💡
OS Linux Debian - 10.5
Browser Electron 83

View run in Cypress Dashboard ➡️


Flakiness

cypress/integration/join.spec.js Flakiness
1 join > should NOT be able to register when zipcode contains only spaces

This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard

uses: treosh/lighthouse-ci-action@v3
with:
urls: |
https://operationcode.org/
Copy link
Contributor Author

@BhuwanChandra BhuwanChandra Oct 7, 2020

Choose a reason for hiding this comment

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

I think it will compare against the urls we have specified here in urls field.

Copy link
Member

Choose a reason for hiding this comment

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

ah okay - willing to try it! Any reason there's no feedback in this PR from Lighthouse?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Its because I have added the lighthouse check on push not on pull requests. I think, I also need to add pull requests into it.

Copy link
Contributor Author

@BhuwanChandra BhuwanChandra Oct 8, 2020

Choose a reason for hiding this comment

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

I have made some changes, now it's showing the lighthouse check.

@kylemh
Copy link
Member

kylemh commented Oct 8, 2020

I see

No GitHub token set, skipping GitHub status check.

in the workflow spot.

Screen Shot 2020-10-08 at 9 20 13 AM

Do we need to do something about that?

Additionally, I'm still not sure what to expect from this check. What would make it fail?

@BhuwanChandra
Copy link
Contributor Author

BhuwanChandra commented Oct 10, 2020

A status check, if configured, is a message that appears on every PR and typically includes information such as the results of a test or the success of a build.

You need to set lighthouse github app in this repository to get the status checks and performance scores on every pull requests.
Capture
something like this.

to set github status check:

  1. go to https://github.com/apps/lighthouse-ci
  2. add lighthouse CI to this repository
  3. add LHCI_GITHUB_APP_TOKEN to the secrets of the repository.

Or we can also add a bot to comment lighthouse scores on each PR.

this is totally optional, otherwise we need to go to the details each time to check the performance scores.

basically in these checks, we can run our lighthouse checks against some predefined performance scores (we need add them into our lighthouserc.js file) and if the current scores are below those predefined scores then this check will get failed.

currently I haven't defined any scores yet, If you want me add the scores let me know I will add some performance scores.

and also let me know if you have enabled the github status check then I need to make some changes in lighthouse.yaml file in order to make it work.

@kylemh
Copy link
Member

kylemh commented Oct 10, 2020

Awesome. Added the token: LHCI_GITHUB_APP_TOKEN to GitHub. Updated your branch! Let's see if it works 🌟

@BhuwanChandra
Copy link
Contributor Author

BhuwanChandra commented Oct 11, 2020

I have made the required changes but still it is showing No GitHub token set, skipping GitHub status check this, can you check once if LHCI_GITHUB_APP_TOKEN is in the secrets of the repository or not?
I have added some minimum scores for each checks and now the checks will get failed if the performance scores are below those scores.

@kylemh
Copy link
Member

kylemh commented Oct 15, 2020

@BhuwanChandra I think it was an annoying typo issue. The actual GitHub app refers to the would-be token as: LHCI_GITHUB_APP_TOKEN, but this workflow expects LHCI_GITHUB_TOKEN 🙃 treosh/lighthouse-ci-action#60 (comment)

@kylemh
Copy link
Member

kylemh commented Oct 15, 2020

Hmmmm, not sure what else could be going on.

I have the token added via secrets under both monikers - just in case:

Screen Shot 2020-10-14 at 5 44 06 PM

I've had them in since you began working on this - ignore the time stamp - I just moved them to the org level instead of just this repository.

@kylemh
Copy link
Member

kylemh commented Oct 18, 2020

Do you want to try this one out https://github.com/OskarAhl/Lighthouse-github-action-comment/blob/main/.github/workflows/lighthouse-on-vercel-preview-url.yml

@BhuwanChandra
Copy link
Contributor Author

Ok, I will try this one!

@codeclimate
Copy link

codeclimate bot commented Oct 30, 2020

Code Climate has analyzed commit 173e8e0 and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 100.0% (90% is the threshold).

This pull request will bring the total coverage in the repository to 83.9% (0.0% change).

View more on Code Climate.

@kylemh kylemh closed this Sep 12, 2023
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.

Use Google's Lighthouse via a CI check
2 participants