-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Yash Khare <[email protected]>
- Loading branch information
1 parent
cf8edf8
commit 7ae110c
Showing
2 changed files
with
64 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,10 +21,70 @@ jobs: | |
run: | | ||
npm install -g @lhci/[email protected] | ||
lhci autorun --config=lighthouserc.json --collect.url="http://localhost:3000" --collect.startServerCommand="npm run start" --upload.outputDir="./lhci-reports/app" | ||
- name: run Lighthouse CI for Keploy.io Deployed Website | ||
# - name: run Lighthouse CI for Keploy.io Deployed Website | ||
# run: | | ||
# npm install -g @lhci/[email protected] | ||
# lhci autorun --config=lighthouserc.json --collect.url="https://www.keploy.io" --upload.outputDir="./lhci-reports/keploy.io" | ||
# - name: Compare Lighthouse Reports | ||
# run: | | ||
# node compare-lhci-reports.js | ||
audit-main: | ||
name: Audit Main Branch | ||
runs-on: ubuntu-latest | ||
steps: | ||
# 1. Checkout the main branch | ||
- name: Checkout Main Branch | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: main | ||
path: main | ||
|
||
# 2. Setup Node.js 18.x for main branch | ||
- name: Setup Node.js for Main | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18.x | ||
|
||
# 3. Install dependencies and build main branch | ||
- name: Install Dependencies and Build Main | ||
run: | | ||
npm install -g @lhci/[email protected] | ||
lhci autorun --config=lighthouserc.json --collect.url="https://www.keploy.io" --upload.outputDir="./lhci-reports/keploy.io" | ||
cd main | ||
npm install | ||
npm run build | ||
# 6. Install Lighthouse CI globally | ||
- name: Install Lighthouse CI | ||
run: npm install -g @lhci/[email protected] | ||
|
||
# 7. Run LHCI for the Main Branch | ||
- name: Run Lighthouse CI for Main Branch | ||
run: | | ||
cd main | ||
lhci autorun --config=../lighthouserc.json --collect.url="http://localhost:3000" --collect.startServerCommand="npm run start" --upload.outputDir="../lhci-reports/main" | ||
compare-reports: | ||
name: Compare Lighthouse Reports | ||
runs-on: ubuntu-latest | ||
needs: [audit-main, lhci] | ||
steps: | ||
# # 1. Download Main Report | ||
# - name: Download Main Report | ||
# uses: actions/download-artifact@v3 | ||
# with: | ||
# name: main-report | ||
# path: ./reports/main | ||
|
||
# # 2. Download PR Report | ||
# - name: Download PR Report | ||
# uses: actions/download-artifact@v3 | ||
# with: | ||
# name: pr-report | ||
# path: ./reports/pr | ||
|
||
# # 3. Checkout the repository (to access scripts) | ||
# - name: Checkout Repository for Scripts | ||
# uses: actions/checkout@v3 | ||
|
||
# 4. Run the Comparison Script | ||
- name: Compare Lighthouse Reports | ||
run: | | ||
node compare-lhci-reports.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters