Skip to content

Commit 9603b48

Browse files
committed
introduce basic lighthouse-ci
1 parent ebc064e commit 9603b48

File tree

2 files changed

+57
-0
lines changed

2 files changed

+57
-0
lines changed

.github/workflows/lighthouse.yml

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Lighthouse CI
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
9+
jobs:
10+
build:
11+
12+
runs-on: ubuntu-latest
13+
14+
strategy:
15+
matrix:
16+
node-version: [ 14.x ]
17+
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v2
21+
22+
- name: Use Node.js ${{ matrix.node-version }}
23+
uses: actions/setup-node@v1
24+
with:
25+
node-version: ${{ matrix.node-version }}
26+
27+
- name: Cache Node.js modules
28+
uses: actions/cache@v2
29+
with:
30+
path: ~/.npm
31+
key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }}
32+
restore-keys: |
33+
${{ runner.OS }}-node-
34+
${{ runner.OS }}-
35+
36+
- name: Install dependencies
37+
run: npm ci
38+
39+
- name: Build
40+
run: npm run build
41+
42+
- name: Run Lighthouse CI
43+
run: |
44+
npm install -g @lhci/[email protected]
45+
lhci autorun --collect.url=http://localhost:9090
46+
lhci autorun --collect.url=http://localhost:9090/#covid19/

lighthouserc.js

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
module.exports = {
2+
ci: {
3+
collect: {
4+
startServerCommand: 'npm run start:examples',
5+
},
6+
upload: {
7+
target: 'temporary-public-storage',
8+
uploadUrlMap: false,
9+
},
10+
},
11+
};

0 commit comments

Comments
 (0)