Comments (16)
I created an example repo for lighthouse+circleci integration—maybe it will help some folks here.
repo: https://github.com/zgreen/lighthouse-circleci-example
blog post: https://offbyone.tech/lighthouse-circleci
from lighthousebot.
@tinovyatkin Did you manage to get the comments on the PR, using circleci?
from lighthousebot.
We can use the service directly:
- run:
name: "Run Lighthouse"
command: |
curl -f -X POST https://lighthouse-ci.appspot.com/run_on_wpt \
-H 'Content-Type: application/json' \
-H "X-API-KEY: ${LIGHTHOUSE_API_KEY}" \
-d "{
\"output\": \"json\",
\"testUrl\": \"https://staging-$CIRCLE_PR_NUMBER-dot-$GOOGLE_PROJECT_ID.appspot.com/book/\",
\"addComment\": true,
\"thresholds\": {
\"performance\": 35,
\"pwa\": 30,
\"accessibility\": 80,
\"best-practices\": 70,
\"seo\": 90
},
\"repo\": {
\"owner\": \"${CIRCLE_PROJECT_USERNAME}\",
\"name\": \"${CIRCLE_PROJECT_REPONAME}\"
},
\"pr\": {
\"number\": ${CIRCLE_PR_NUMBER},
\"sha\": \"$CIRCLE_SHA1\"
}
}"
from lighthousebot.
@jakeleboeuf @kanolato
lighthouse-keeper is the new lighthouse bot that supports multiple CIs as well as detecting differences between PR branch and master branch. You should check it out!
from lighthousebot.
@tinovyatkin I do not recommend relying on https://lighthouse-ci.appspot.com/run_on_wpt. It can change at any time and I make no guarantees on uptime. It's for testing.
from lighthousebot.
This system is generic enough that you should be able to set it up with any CI server. Namely just run the runlighthouse.js
script against a staged URL or fire up a local server and test agains that.
https://github.com/ebidel/lighthouse-ci#auditing-github-pull-requests
https://github.com/ebidel/lighthouse-ci#running-your-own-ci-server
from lighthousebot.
Thanks Eric!
process.env.TRAVIS_PULL_REQUEST_SLUG is of course not available in CircleCI, so repoSlug.split('/')[0]
will throw an error.
from lighthousebot.
Ah yes :) Thanks for keeping me honest. TBH, I haven't used Circle CI before. If changes are minimal, I'd be happy to take a PR that adds support. The other thing you could do is take runlighthouse.js
as a starter and adapt it to CircleCI.
from lighthousebot.
Haha, no problem! I’ll take a look in the morning and see how minimal the change would be to add that flag. If it’s a small update, I’ll send a PR- otherwise I’ll just fork and run.
from lighthousebot.
Thanks! I'd also like to understand the changes. Maybe you can help list them here if the change becomes too much?
from lighthousebot.
Same issue here. This script is coupled to TRAVIS. I just copied it and tweaking for Circle
from lighthousebot.
Is there a fork or any documentation on getting this up and running on CircleCI?
from lighthousebot.
Did somebody already make it work for Circle CI? Any guidance on how to do it or implementing would be appreciated.
from lighthousebot.
@zgreen thank you for your example repo! however, it seems the blog post is not available atm (404), do you have it available somewhere else?
from lighthousebot.
Hmm, the link seems to work for me. Note that it should be https://offbyone.tech/lighthouse-circleci and not https://offbyone.tech/lighthouse-circleci/, looks like my blog isn't handling trailing slashes properly 🙃
from lighthousebot.
@zgreen the trailing slash didn't make a difference for me but it seems to be a browser issue since it works for me in Safari but not in Chrome. Thanks anyway, time to read! 🤓
from lighthousebot.
Related Issues (20)
- Azure Pipelines support
- Clarify that this repo is not the same as lighthouse-ci on npm HOT 1
- Error: no such file or directory, /home/chrome/reports/report.<hash>.json HOT 5
- Slack integration
- Public-facing URL: needed? HOT 6
- How long does it take for the bot to accept the collaborator request? HOT 20
- Returning performance 0 (error) every time HOT 3
- Serverless frontend, backend and bot? HOT 1
- Will lighthousebot supports the authenticated web pages?
- npx alternative?
- lighthouse bot succeeds even when minimum required threshold is not met HOT 3
- Failing to build the docker container (Example) HOT 1
- Pass github error down to the client for debugging
- CI always return 0 score from lighthouse bot HOT 1
- Provide option to set throttling?
- GithubActions docs
- Feature request: GitHub Actions support HOT 3
- Error from CI backend. invalid json response body HOT 1
- Run in multiple build stages?
- LHError: INVALID_URL
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lighthousebot.