Skip to content

Commit

Permalink
compare with main branch
Browse files Browse the repository at this point in the history
Signed-off-by: Yash Khare <[email protected]>
  • Loading branch information
khareyash05 committed Dec 17, 2024
1 parent cf8edf8 commit 7ae110c
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 4 deletions.
66 changes: 63 additions & 3 deletions .github/workflows/lighthouse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion compare-lhci-reports.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function loadReport(path) {
}

const appReportDirectory = './lhci-reports/app';
const keployReportDirectory = './lhci-reports/keploy.io';
const keployReportDirectory = './lhci-reports/main';

const appReportPath = findReportFile(appReportDirectory);
const keployReportPath = findReportFile(keployReportDirectory);
Expand Down

0 comments on commit 7ae110c

Please sign in to comment.