Skip to content
This repository has been archived by the owner on Jul 8, 2020. It is now read-only.

Circle CI support #16

Open
jakeleboeuf opened this issue Dec 11, 2017 · 16 comments · May be fixed by #68
Open

Circle CI support #16

jakeleboeuf opened this issue Dec 11, 2017 · 16 comments · May be fixed by #68

Comments

@jakeleboeuf
Copy link

Any chance you'll add in support for Circle CI?

@ebidel
Copy link
Contributor

ebidel commented Dec 11, 2017

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

@jakeleboeuf
Copy link
Author

Thanks Eric!

process.env.TRAVIS_PULL_REQUEST_SLUG is of course not available in CircleCI, so repoSlug.split('/')[0] will throw an error.

@ebidel
Copy link
Contributor

ebidel commented Dec 11, 2017

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.

@jakeleboeuf
Copy link
Author

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.

@ebidel
Copy link
Contributor

ebidel commented Dec 12, 2017

Thanks! I'd also like to understand the changes. Maybe you can help list them here if the change becomes too much?

@patrickmichalina
Copy link

Same issue here. This script is coupled to TRAVIS. I just copied it and tweaking for Circle

@jimjeffers
Copy link

Is there a fork or any documentation on getting this up and running on CircleCI?

@gepser
Copy link

gepser commented May 14, 2018

Did somebody already make it work for Circle CI? Any guidance on how to do it or implementing would be appreciated.

@zgreen
Copy link

zgreen commented May 14, 2018

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

@tinovyatkin
Copy link

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\"
                        }
                      }"

@ebidel
Copy link
Contributor

ebidel commented Jan 28, 2019

@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.

@eahlberg
Copy link

eahlberg commented Feb 1, 2019

@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?

@zgreen
Copy link

zgreen commented Feb 1, 2019

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 🙃

@eahlberg
Copy link

eahlberg commented Feb 1, 2019

@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! 🤓

@kanolato
Copy link

@tinovyatkin Did you manage to get the comments on the PR, using circleci?

This was referenced Jul 8, 2019
@krzkaczor
Copy link

@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!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants