treosh / lighthouse-ci-action

Audit URLs using Lighthouse and test performance with Lighthouse CI.
MIT License
1.17k stars 82 forks source link

[Previews] Netlify integration #31

Closed denar90 closed 4 years ago

denar90 commented 4 years ago

Nice to have check for none production URLs (preview). Netlify has this feature, it just builds user site against branch/PR user/collaborator pushed. Then user sees perf results for the new changes in PR using the same action.

PoC PR - #30

Main problem is race conditions: Netlify can deploy longer then action starts to check, we need to wait for the Netlify to finish and then run action

I've researched a bit and looks like it's tricky to wait for Netlify build to be finished.

Q: on a pr -> run a node script -> script calls the github checks API -> creates a NEW completed check with a preview url. A: Actions currently doesn't support the behavior you're describing. On the other hand, a GitHub App could do the kind of thing that you're talking about by updating the details_url value on the check run that it creates. https://github.community/t5/GitHub-Actions/Use-action-to-deploy-and-return-a-preview-URL/td-p/29214

I think it can be a bit complicated for PoC. Let's try just ping preview URL for N minutes (we can even add option for that in case of really long builds) until it returns 200.

Thoughts?