From bad22404c71e40e62b87a9b87a25ae3c7a9e31f5 Mon Sep 17 00:00:00 2001 From: Johan Bisse Mattsson Date: Tue, 5 Nov 2024 10:44:53 +0100 Subject: [PATCH] LWS-159: Add env vars for Lighthouse server auth (#1120) * Add env vars for Lighthouse server auth * Fix misspelled token var * Add serverBaseUrl to lhci command * Set lhci upload target * Add LHCI_TOKEN * Bump @lhci/cli version * Revert to older @lhci/cli@0.13.x version * Try fixing ancestor hash issue See: https://github.com/GoogleChrome/lighthouse-ci/blob/main/docs/troubleshooting.md#running-lhci-in-github-actions-i-constantly-get-ancestor-hash-not-determinable * Try fixing ancestor issue again See: https://github.com/GoogleChrome/lighthouse-ci/blob/main/docs/troubleshooting.md#running-lhci-in-github-actions-i-constantly-get-ancestor-hash-not-determinable * Revert ancestor changes * Sync lhci/cli version again * Sync @lhci/cli version again * Fix misspelled env var doh * Use config file instead of CLI flags * Use ESM code * Rename to .lighthouserc.cjs * Revert to using json config file and cli flags * Another go using upload settings in a config file again * Revert to json config and cli flags again... * Add .lighthouseci to gitignore * Check if env variables are set correctly * Another test * Revert check change * Remove echo * Hopefully the last change... * Set basic auth using CLI flags * Set basic auth using env secrets * Add cli flag for basic auth * Add bash shell * Remove cli flags again * Update env names * Try reverting to working commit * Here we go again * and again * is this causing the issue? * Probably due to missing basicAuth params in docker container * Remove echo --- .github/workflows/lxl-web.yml | 9 +++++++-- lxl-web/.gitignore | 1 + 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/lxl-web.yml b/.github/workflows/lxl-web.yml index dda3148b0..0daea8a78 100644 --- a/.github/workflows/lxl-web.yml +++ b/.github/workflows/lxl-web.yml @@ -46,11 +46,16 @@ jobs: - name: Install dependencies run: npm ci - name: Build and run Lighthouse CI + shell: bash env: API_URL: ${{ secrets.API_URL }} ID_URL: ${{ secrets.ID_URL }} + LHCI_SERVER_BASE_URL: ${{ secrets.LHCI_SERVER_BASE_URL }} + LHCI_TOKEN: ${{ secrets.LHCI_TOKEN }} LHCI_GITHUB_APP_TOKEN: ${{ secrets.LHCI_GITHUB_APP_TOKEN }} + LHCI_SERVER_USERNAME: ${{ secrets.LHCI_SERVER_USERNAME }} + LHCI_SERVER_PASSWORD: ${{ secrets.LHCI_SERVER_PASSWORD }} run: | npm run build - npm install -g @lhci/cli@0.13.x - lhci autorun --upload.githubToken="$LHCI_GITHUB_TOKEN" || echo "LHCI failed!" + npm install -g @lhci/cli@0.14.0 + lhci autorun --upload.target=lhci --upload.serverBaseUrl="$LHCI_SERVER_BASE_URL" --upload.token="$LHCI_TOKEN" --upload.githubToken="$LHCI_GITHUB_APP_TOKEN" --upload.basicAuth.username="$LHCI_SERVER_USERNAME" --upload.basicAuth.password="$LHCI_SERVER_PASSWORD" || echo "LHCI failed!" diff --git a/lxl-web/.gitignore b/lxl-web/.gitignore index 60f5097ff..045614351 100644 --- a/lxl-web/.gitignore +++ b/lxl-web/.gitignore @@ -9,3 +9,4 @@ node_modules vite.config.js.timestamp-* vite.config.ts.timestamp-* /test-results +.lighthouseci/ \ No newline at end of file