fix(ci): add hardcoded fallback for puppeteer chrome in lighthouse
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 8s
Nightly QA / 🔗 Links & Deps (push) Failing after 2m48s
Build & Deploy / 🏗️ Build (push) Has been cancelled
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Post-Deploy Verification (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
Build & Deploy / 🧪 QA (push) Has been cancelled
Nightly QA / ♿ Accessibility (push) Successful in 5m21s
Nightly QA / 🔔 Notify (push) Has been cancelled
Nightly QA / 🔍 Static Analysis (push) Has been cancelled
Nightly QA / 🎭 Lighthouse (push) Has been cancelled
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 8s
Nightly QA / 🔗 Links & Deps (push) Failing after 2m48s
Build & Deploy / 🏗️ Build (push) Has been cancelled
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Post-Deploy Verification (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
Build & Deploy / 🧪 QA (push) Has been cancelled
Nightly QA / ♿ Accessibility (push) Successful in 5m21s
Nightly QA / 🔔 Notify (push) Has been cancelled
Nightly QA / 🔍 Static Analysis (push) Has been cancelled
Nightly QA / 🎭 Lighthouse (push) Has been cancelled
This commit is contained in:
@@ -95,12 +95,41 @@ async function main() {
|
|||||||
console.log(`✅ Detected Puppeteer Chrome at: ${chromePath}`);
|
console.log(`✅ Detected Puppeteer Chrome at: ${chromePath}`);
|
||||||
}
|
}
|
||||||
} catch (e: any) {
|
} catch (e: any) {
|
||||||
console.warn(`⚠️ Could not detect Puppeteer Chrome path automatically: ${e.message}`);
|
console.warn(`⚠️ Could not detect Puppeteer Chrome path via command: ${e.message}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Fallback to known paths if still not found
|
||||||
|
if (!chromePath) {
|
||||||
|
const fallbacks = [
|
||||||
|
'/root/.cache/puppeteer/chrome/linux-145.0.7632.77/chrome-linux64/chrome',
|
||||||
|
'/home/runner/.cache/puppeteer/chrome/linux-145.0.7632.77/chrome-linux64/chrome',
|
||||||
|
path.join(
|
||||||
|
process.cwd(),
|
||||||
|
'node_modules',
|
||||||
|
'.puppeteer',
|
||||||
|
'chrome',
|
||||||
|
'linux-145.0.7632.77',
|
||||||
|
'chrome-linux64',
|
||||||
|
'chrome',
|
||||||
|
),
|
||||||
|
];
|
||||||
|
|
||||||
|
for (const fallback of fallbacks) {
|
||||||
|
if (fs.existsSync(fallback)) {
|
||||||
|
chromePath = fallback;
|
||||||
|
console.log(`✅ Found Puppeteer Chrome at fallback: ${chromePath}`);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
console.log(`ℹ️ Using existing Chrome path: ${chromePath}`);
|
console.log(`ℹ️ Using existing Chrome path: ${chromePath}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!chromePath) {
|
||||||
|
console.warn('❌ CHROME_PATH is still undefined. Lighthouse might fail.');
|
||||||
|
}
|
||||||
|
|
||||||
const chromePathArg = chromePath ? `--collect.chromePath="${chromePath}"` : '';
|
const chromePathArg = chromePath ? `--collect.chromePath="${chromePath}"` : '';
|
||||||
|
|
||||||
// Clean up old reports
|
// Clean up old reports
|
||||||
|
|||||||
Reference in New Issue
Block a user