Skip to content

Commit 33c9ee4

Browse files
committed
Initial push of lighthouse-ci & lighthous-ci-action
1 parent 0bf03f5 commit 33c9ee4

File tree

4 files changed

+113
-0
lines changed

4 files changed

+113
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# TODO: LIGHTHOUSE-CI-ACTION
2+
name: Lighthouse CI
3+
on: [push]
4+
5+
jobs:
6+
lighthouse:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v2
10+
- uses: actions/setup-node@v1
11+
- run: npm install && npm install -g @lhci/[email protected]
12+
- run: npm run build
13+
- run: lhci autorun --upload.target=temporary-public-storage
14+
- name: Audit URL's using Lighthouse
15+
uses: treosh/lighthouse-ci-action@v3
16+
with:
17+
node-version: 10.x
18+
outputDirectory: /tmp/artifacts
19+
urls: 'https://docsify.js.org/#/' # URL to audit using Lighthouse
20+
budgetPath: .budget.json # test performance budgets
21+
uploadArtifacts: true # save results as an action artifacts
22+
temporaryPublicStorage: true # upload whitehouse report to the temporary storage
23+
- name: Upload artifacts
24+
uses: actions/upload-artifact@master
25+
with:
26+
name: Lighthouse reports
27+
path: /tmp/artifacts

.github/workflows/lighthouse-ci.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# TODO: LIGHTHOUSE-CI
2+
# name: Lighthouse CI
3+
# on: [push]
4+
5+
# jobs:
6+
# lighthouse:
7+
# runs-on: ubuntu-latest
8+
# steps:
9+
# - uses: actions/checkout@v2
10+
# - uses: actions/setup-node@v1
11+
# - run: npm install && npm install -g @lhci/[email protected]
12+
# - run: npm run build
13+
# - run: lhci autorun --upload.target=temporary-public-storage
14+
# - name: Audit URL's using Lighthouse
15+
# uses: treosh/lighthouse-ci-action@v3
16+
# with:
17+
# node-version: 10.x
18+
# outputDirectory: /tmp/artifacts
19+
# urls: 'https://docsify.js.org/#/' # URL to audit using Lighthouse
20+
# budgetPath: .budget.json # test performance budgets
21+
# uploadArtifacts: true # save results as an action artifacts
22+
# temporaryPublicStorage: true # upload whitehouse report to the temporary storage
23+
# - name: Upload artifacts
24+
# uses: actions/upload-artifact@master
25+
# with:
26+
# name: Lighthouse reports
27+
# path: /tmp/artifacts
28+
29+
name: Lighthouse CI
30+
31+
on:
32+
push:
33+
branches:
34+
- master
35+
- develop
36+
pull_request:
37+
branches:
38+
- master
39+
- develop
40+
41+
jobs:
42+
build:
43+
runs-on: ubuntu-16.04
44+
runs-on: ubuntu-latest
45+
strategy:
46+
matrix:
47+
node-version: [10.x, 12.x, 13.x]
48+
49+
steps:
50+
- uses: actions/checkout@v1
51+
- name: Use Node.js ${{ matrix.node-version }}
52+
uses: actions/setup-node@v1
53+
with:
54+
node-version: ${{ matrix.node-version }}
55+
- name: npm install, build
56+
run: |
57+
npm install
58+
npm run build
59+
- name: run Lighthouse CI
60+
run: |
61+
npm install -g @lhci/[email protected]
62+
lhci autorun

budget.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// TODO: LIGHTHOUSE-CI
2+
[
3+
{
4+
"path": "/*",
5+
"resourceSizes": [
6+
{
7+
"resourceType": "document",
8+
"budget": 18
9+
},
10+
{
11+
"resourceType": "total",
12+
"budget": 200
13+
}
14+
]
15+
}
16+
]

lighthouserc.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// TODO: LIGHTHOUSE-CI
2+
module.exports = {
3+
ci: {
4+
upload: {
5+
target: 'temporary-public-storage',
6+
},
7+
},
8+
};

0 commit comments

Comments
 (0)