diff --git a/docs/getting-started.md b/docs/getting-started.md index 8feaf4868..60461691c 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -168,7 +168,7 @@ module.exports = { **.gitlab-ci.yml** ```yaml -image: cypress/browsers:node10.16.0-chrome77 +image: cypress/browsers:node14.15.0-chrome86-ff82 lhci: script: - npm install @@ -221,6 +221,58 @@ lhci autorun +
+Google Cloudbuild +
+ +**NOTE:** Learn more about the [security tradeoffs](./recipes/docker-client/README.md#--no-sandbox-container-tradeoffs) behind use of the `--no-sandbox` Chrome option before proceeding. + +**.lighthouserc.js** + +```js +module.exports = { + ci: { + collect: { + settings: {chromeFlags: '--no-sandbox'}, + }, + upload: { + target: 'temporary-public-storage', + }, + }, +}; +``` + +**Notes** +* `LHCI_BUILD_CONTEXT__CURRENT_BRANCH` doesn't pick up the right variables in cloudbuild so passing through `$BRANCH_NAME` will fix this. +* `machineType` defines the machine you can pick. The bigger the machine the more stable the performance results will be (see [Lighthouse variability documentation](https://github.com/GoogleChrome/lighthouse/blob/master/docs/variability.md)). WARNING: Look through the [Cloudbuild machine pricing](https://cloud.google.com/cloud-build/pricing) before deciding on a machine type. + +**cloudbuild.yml** + +```yaml +steps: + - id: 'install' + args: ['npm', 'ci'] + name: node:14-alpine + + - id: 'build' + waitFor: ['install'] + name: node:14-alpine + args: ['npm', 'run', 'build'] + + - id: 'lighthouse' + waitFor: ['build'] + name: cypress/browsers:node14.15.0-chrome86-ff82 + entrypoint: '/bin/sh' + args: ['-c', 'npm install -g @lhci/cli@0.6.x && lhci autorun --failOnUploadFailure'] + env: + - 'LHCI_BUILD_CONTEXT__CURRENT_BRANCH=$BRANCH_NAME' + +options: + machineType: 'N1_HIGHCPU_8' +``` + +
+ That's it! With this in place, you'll have Lighthouse reports collected and uploaded with links to each report on every push. Temporary public storage provides access to individual reports, but not historical data, report diffing, or build failures. Read on to find out how to [add assertions](#add-assertions), configure the [Lighthouse CI server](#the-lighthouse-ci-server) for report diffs and timeseries charts, and enable [GitHub status checks](#github-status-checks). diff --git a/docs/introduction-to-ci.md b/docs/introduction-to-ci.md index e64333013..be038a1a8 100644 --- a/docs/introduction-to-ci.md +++ b/docs/introduction-to-ci.md @@ -32,3 +32,4 @@ There are many CI providers out there to choose from. Lighthouse CI works with a - [GitLab CI](https://docs.gitlab.com/ee/ci/quick_start/) - [Travis CI](https://docs.travis-ci.com/user/tutorial/) - [Circle CI](https://circleci.com/docs/2.0/getting-started/) +- [Google Cloudbuild](https://cloud.google.com/cloud-build/docs/quickstart-build)