You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 8, 2020. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+23-13Lines changed: 23 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,6 +18,18 @@ To audit pull requests, do the following:
18
18
19
19
First, add [lighthousebot](https://github.com/lighthousebot) as a collaborator on your repo. Lighthouse CI uses an OAuth token scoped to the `repo` permission in order to update the status of your PRs and post comments on the issue as the little Lighthouse icon.
20
20
21
+
#### Install the script
22
+
23
+
npm i --save-dev https://github.com/ebidel/lighthouse-ci
24
+
25
+
Add an NPM script to your `package.json`:
26
+
27
+
```js
28
+
"scripts": {
29
+
"lh":"lighthouse-ci"
30
+
}
31
+
```
32
+
21
33
#### Get an API Key
22
34
23
35
[Request an API Key](https://goo.gl/forms/9BzzhHd1sKzsvyC52). API keys will eventually be
@@ -48,19 +60,7 @@ after_success:
48
60
49
61
### 3. Call lighthouse-ci
50
62
51
-
Install the script:
52
-
53
-
npm i --save-dev https://github.com/ebidel/lighthouse-ci
54
-
55
-
Add an NPM script to your `package.json`:
56
-
57
-
```js
58
-
"scripts": {
59
-
"lh":"lighthouse-ci"
60
-
}
61
-
```
62
-
63
-
Next, in `.travis.yml` call [`npm run lh`][runlighthouse-link] as the last step in `after_success`:
63
+
If you're deploying your site through Travis; in `.travis.yml` call [`npm run lh`][runlighthouse-link] as the last step in `after_success`:
64
64
65
65
```yml
66
66
install:
@@ -70,6 +70,16 @@ after_success:
70
70
- npm run lh https://staging.example.com
71
71
```
72
72
73
+
If you've deployed your site through another service and just want to run lighthouse tests [as a job](https://docs.travis-ci.com/user/conditional-builds-stages-jobs/):
74
+
75
+
```yml
76
+
jobs:
77
+
include:
78
+
- stage: lighthouse
79
+
if: type = api # Only run this job when Travis is triggered via API
80
+
script: npm run lh https://staging.example.com
81
+
```
82
+
73
83
When Lighthouse is done auditing the URL, the CI will post a comment to the pull
0 commit comments