foo-software / lighthouse-check-action

GitHub Action for running @GoogleChromeLabs Lighthouse audits with all the bells and whistles 🔔 Multiple audits, Slack notifications, and more!
https://github.com/marketplace/actions/lighthouse-check
MIT License
480 stars 24 forks source link

CHROME_PATH environment variable must be set to a Chrome/Chromium executable #79

Closed uluzox closed 2 years ago

uluzox commented 2 years ago

Hi, I am trying to use this GH Action on a GitHub Enterprise instance.

My workflow

---
name: Lighthouse

on:
  workflow_dispatch

jobs:
  lighthouse:
    runs-on: [self-hosted]
    steps:
      - name: Lighthouse
        uses: foo-software/lighthouse-check-action@v7.1.1
        with:
          urls: 'https://google.de'

On run it fails with

lighthouse-check: Auditing mobile (1/1): https://google.de
lighthouse-check:
 ChromePathNotSetError
    at new LauncherError (/runner/_work/_actions/foo-software/lighthouse-check-action/v7.1.1/node_modules/chrome-launcher/dist/utils.js:26:22)
    at new ChromePathNotSetError (/runner/_work/_actions/foo-software/lighthouse-check-action/v7.1.1/node_modules/chrome-launcher/dist/utils.js:33:9)
    at Object.linux (/runner/_work/_actions/foo-software/lighthouse-check-action/v7.1.1/node_modules/chrome-launcher/dist/chrome-finder.js:128:15)
    at Function.getFirstInstallation (/runner/_work/_actions/foo-software/lighthouse-check-action/v7.1.1/node_modules/chrome-launcher/dist/chrome-launcher.js:117:51)
    at Launcher.launch (/runner/_work/_actions/foo-software/lighthouse-check-action/v7.1.1/node_modules/chrome-launcher/dist/chrome-launcher.js:176:43)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async Object.launch (/runner/_work/_actions/foo-software/lighthouse-check-action/v7.1.1/node_modules/chrome-launcher/dist/chrome-launcher.js:37:5)
    at async exports.default (/runner/_work/_actions/foo-software/lighthouse-check-action/v7.1.1/node_modules/@foo-software/lighthouse-persist/dist/lighthousePersist.js:93:26)
    at async localLighthouse (/runner/_work/_actions/foo-software/lighthouse-check-action/v7.1.1/node_modules/@foo-software/lighthouse-check/dist/localLighthouse.js:83:7)
    at async getLocalLighthouseResultsWithRetries (/runner/_work/_actions/foo-software/lighthouse-check-action/v7.1.1/node_modules/@foo-software/lighthouse-check/dist/localLighthouse.js:124:29) {
  message: 'The CHROME_PATH environment variable must be set to a Chrome/Chromium executable no older than Chrome stable.',
  code: 'ERR_LAUNCHER_PATH_NOT_SET'
}
Error: The CHROME_PATH environment variable must be set to a Chrome/Chromium executable no older than Chrome stable.
adamhenson commented 2 years ago

@uluzox - Based on the error message below...

Error: The CHROME_PATH environment variable must be set to a Chrome/Chromium executable no older than Chrome stable.

It seems that your self-hosted runner doesn't have Chrome installed, or it's not installed in a way that Lighthouse expects. Maybe this issue can help. Otherwise, I would recommend just using runs-on: ubuntu-latest unless there is a reason not to.

I'm closing this as the issue is not related to this GitHub Action.