File tree Expand file tree Collapse file tree 1 file changed +48
-0
lines changed
Expand file tree Collapse file tree 1 file changed +48
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Lighthouse score
2+
3+ on :
4+ pull_request :
5+ branches :
6+ - ' **'
7+
8+ jobs :
9+ lighthouse :
10+ runs-on : ubuntu-latest
11+ steps :
12+ - name : Checkout PR branch
13+ uses : actions/checkout@v4
14+
15+ - name : Set up Node.js
16+ uses : actions/setup-node@v4
17+ with :
18+ node-version : 18
19+
20+ - name : Install static server
21+ run : npm install -g serve
22+
23+ - name : Serve PR branch (background on port 3001)
24+ run : |
25+ serve . -l 3001 &
26+ sleep 5
27+ - name : Checkout main branch into separate folder
28+ run : |
29+ git fetch origin main
30+ git worktree add main-branch origin/main
31+ - name : Serve Main branch (background on port 3000)
32+ run : |
33+ cd main-branch
34+ serve . -l 3000 &
35+ cd ..
36+ sleep 5
37+
38+ - name : Create output directory for Lighthouse
39+ run : mkdir -p ${{ github.workspace }}/tmp/artifacts
40+
41+ - name : Run Lighthouse audit for both PR and Main
42+ uses : foo-software/lighthouse-check-action@master
43+ with :
44+ gitAuthor : ${{ github.actor }}
45+ gitBranch : ${{ github.head_ref }}
46+ outputDirectory : ${{ github.workspace }}/tmp/artifacts
47+ urls : ' http://localhost:3000/?branch=main,http://localhost:3001/?branch=pr'
48+ sha : ${{ github.sha }}
You can’t perform that action at this time.
0 commit comments