ci(lighthouse): skip Chrome install when already present
This commit is contained in:
@@ -19,9 +19,14 @@ jobs:
|
||||
|
||||
- name: Install Google Chrome
|
||||
run: |
|
||||
apt-get update
|
||||
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
|
||||
apt install -y ./google-chrome*.deb
|
||||
if command -v google-chrome-stable >/dev/null 2>&1; then
|
||||
echo "Chrome already present."
|
||||
else
|
||||
apt-get update
|
||||
wget -q https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
|
||||
apt install -y ./google-chrome*.deb
|
||||
fi
|
||||
google-chrome-stable --version
|
||||
|
||||
- name: Install global packages
|
||||
run: npm i -g pm2 @sasjs/cli wait-on
|
||||
|
||||
@@ -51,7 +51,7 @@ This project includes automated Lighthouse performance and accessibility checks
|
||||
The Lighthouse CI workflow:
|
||||
1. Sets up the development environment with SASjs server and mocked services
|
||||
2. Builds and serves the Angular frontend
|
||||
3. Runs Lighthouse CI against key application pages
|
||||
3. Installs Chrome (if absent) and runs `lhci autorun` (Lighthouse CI) against key pages
|
||||
4. Uploads results as artifacts for review
|
||||
|
||||
To run Lighthouse checks locally:
|
||||
@@ -61,4 +61,4 @@ npm install
|
||||
npm run lighthouse
|
||||
```
|
||||
|
||||
Configuration is in `client/lighthouserc.js`.
|
||||
Configuration is in `client/lighthouserc.js` (URL list, `desktop` preset, Chrome flags, assertions).
|
||||
|
||||
Reference in New Issue
Block a user