lighthouse
Lighthouse by Google has become increasingly more popular in recent years — even to the point where companies start seeing measurable increase in profit when their performance is improved.
近年来,Google的Lighthouse变得越来越流行-甚至当公司的业绩提高时,公司开始看到利润的可衡量的增长。
Some colleagues and I thought to ourselves — why not have a way for our developers to see how their projects perform in Lighthouse. Preferably we wanted the test to run in our CI environment Azure Pipelines. We set some goals for the project, and I went to work:
我和一些同事对自己进行了思考-为什么不让开发人员了解他们的项目在Lighthouse中的表现。 最好我们希望该测试在我们的CI环境Azure管道中运行。 我们为该项目设定了一些目标,然后我开始工作:
- A continuous measurement of several Lighthouse categories every time the code changes 每次代码更改时,连续测量几个Lighthouse类别
- Each project should be able to define their own goals and have them measured 每个项目都应该能够定义自己的目标并进行衡量
- The Lighthouse score should be tracked on a timeline to see the historic trends 应该在时间轴上跟踪Lighthouse分数,以查看历史趋势
完美的工具 (The perfect tool)
The Google Chrome team already published a CLI for Node, that can run the tests, generate a report, and upload that report to a reporting server.
Google Chrome团队已经发布了Node的CLI ,该CLI可以运行测试,生成报告并将该报告上传到报告服务器 。
We did some research and found an extension to Azure Pipelines that wraps the CLI from Google, including an article explaining how to use it, and I discovered a Docker container wrapper for the Lighthouse CI reporting server. That was pretty much everything I needed.
我们进行了一些研究,发现了Azure Pipelines的扩展,该扩展包装了Google的CLI,其中包括一篇介绍如何使用 CLI 的文章 ,我发现了 Lighthouse CI报告服务器的Docker容器包装 。 那几乎就是我需要的一切。
The architecture for the Azure Pipelines build could then look like this:
然后,Azure Pipelines构建的体系结构应如下所示: