File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- # Needs to be redone
2- name : Lighthouse Aduit
1+ name : Lighthouse Audit
2+
3+ on :
4+ workflow_call :
5+
6+ jobs :
7+ lighthouse :
8+ name : Lighthouse Audit
9+ runs-on : ubuntu-latest
10+
11+ steps :
12+ - name : Checkout repo
13+ uses : actions/checkout@v4
14+
15+ - name : Setup Node.js
16+ uses : actions/setup-node@v4
17+ with :
18+ node-version : 20
19+
20+ - name : Install dependencies
21+ run : npm ci
22+
23+ - name : Build app
24+ run : npm run build
25+
26+ - name : Start server
27+ run : npm run start &
28+
29+ - name : Wait for server
30+ run : npx wait-on http://localhost:3000
31+
32+ - name : Install Lighthouse CI
33+ run : npm install -g @lhci/cli
34+
35+ - name : Run Lighthouse and generate HTML report
36+ run : |
37+ mkdir -p lhci-reports
38+ lhci collect \
39+ --url=http://localhost:3000 \
40+ --numberOfRuns=3 \
41+ --settings.chromeFlags="--headless" \
42+ --output=json > lhci-reports/report.json
43+ lhci assert || echo "Assertions skipped for visibility"
44+ npx lhci generate --output=lhci-reports/report.html
45+
46+ - name : Upload Lighthouse report as artifact
47+ uses : actions/upload-artifact@v4
48+ with :
49+ name : lighthouse-report
50+ path : lhci-reports/report.html
Original file line number Diff line number Diff line change 2020 # upload-coverage: true
2121 # coverage-threshold: 80
2222
23- # security:
24- # name: Security Scan
25- # uses: ./.github/workflows/security.yaml
26- # with:
27- # audit-level: moderate
23+ audit :
24+ name : Lighthous Aduit
25+ uses : ./.github/workflows/audit.yaml
2826
2927 # build:
3028 # name: Build Check
You can’t perform that action at this time.
0 commit comments