diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a6e4ec91f..e95cc3002 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,7 +20,7 @@ jobs: YARN_GPG: 'no' steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: 0 - name: Use Node.js 16.x @@ -68,7 +68,7 @@ jobs: options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: 0 - name: Use Node.js 16.x diff --git a/README.md b/README.md index 65461502d..527319f9b 100644 --- a/README.md +++ b/README.md @@ -17,11 +17,11 @@ jobs: lighthouseci: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v1 + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 with: node-version: 16 - - run: npm install && npm install -g @lhci/cli@0.8.x + - run: npm install && npm install -g @lhci/cli@0.11.x - run: npm run build - run: lhci autorun ``` diff --git a/docs/complex-setup.md b/docs/complex-setup.md index 7606f87fe..d1a3e3d59 100644 --- a/docs/complex-setup.md +++ b/docs/complex-setup.md @@ -24,7 +24,7 @@ fi npm run deploy -npm install -g @lhci/cli@0.8.x +npm install -g @lhci/cli@0.11.x lhci healthcheck --fatal lhci collect --url=http://localhost:9000/index.html lhci assert --preset="lighthouse:recommended" @@ -121,7 +121,7 @@ Now that we have our environment ready, time to run Lighthouse CI. The `collect` # Install Lighthouse CI # If you're already using node to manage your project, add it to your package.json `devDependencies` instead to skip this step. -npm install -g @lhci/cli@0.8.x +npm install -g @lhci/cli@0.11.x # Run a healthcheck to make sure everything looks good before we run collection. lhci healthcheck --fatal diff --git a/docs/getting-started.md b/docs/getting-started.md index 89ec4f681..928d50997 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -84,9 +84,9 @@ jobs: name: Lighthouse runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Use Node.js 16.x - uses: actions/setup-node@v1 + uses: actions/setup-node@v3 with: node-version: 16.x - name: npm install, build @@ -95,7 +95,7 @@ jobs: npm run build - name: run Lighthouse CI run: | - npm install -g @lhci/cli@0.8.x + npm install -g @lhci/cli@0.11.x lhci autorun ``` @@ -113,7 +113,7 @@ node_js: v16 addons: chrome: stable before_install: - - npm install -g @lhci/cli@0.8.x + - npm install -g @lhci/cli@0.11.x script: - npm run build - lhci autorun @@ -141,7 +141,7 @@ jobs: - browser-tools/install-chrome - run: npm install - run: npm run build - - run: sudo npm install -g @lhci/cli@0.8.x + - run: sudo npm install -g @lhci/cli@0.11.x - run: lhci autorun ``` @@ -176,7 +176,7 @@ lhci: script: - npm install - npm run build - - npm install -g @lhci/cli@0.8.x + - npm install -g @lhci/cli@0.11.x - lhci autorun --upload.target=temporary-public-storage --collect.settings.chromeFlags="--no-sandbox" || echo "LHCI failed!" ``` @@ -218,7 +218,7 @@ npm run build export CHROME_PATH=$(which google-chrome-stable) export LHCI_BUILD_CONTEXT__EXTERNAL_BUILD_URL="$BUILD_URL" -npm install -g @lhci/cli@0.8.x +npm install -g @lhci/cli@0.11.x lhci autorun ``` @@ -267,7 +267,7 @@ steps: waitFor: ['build'] name: cypress/browsers:node16.17.0-chrome106 entrypoint: '/bin/sh' - args: ['-c', 'npm install -g @lhci/cli@0.8.x && lhci autorun --failOnUploadFailure'] + args: ['-c', 'npm install -g @lhci/cli@0.11.x && lhci autorun --failOnUploadFailure'] env: - 'LHCI_BUILD_CONTEXT__CURRENT_BRANCH=$BRANCH_NAME' @@ -360,11 +360,11 @@ jobs: name: Lighthouse runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: ref: ${{ github.event.pull_request.head.sha }} - name: Use Node.js 16.x - uses: actions/setup-node@v1 + uses: actions/setup-node@v3 with: node-version: 16.x - name: npm install, build @@ -373,7 +373,7 @@ jobs: npm run build - name: run Lighthouse CI run: | - npm install -g @lhci/cli@0.8.x + npm install -g @lhci/cli@0.11.x lhci autorun env: LHCI_GITHUB_APP_TOKEN: ${{ secrets.LHCI_GITHUB_APP_TOKEN }} @@ -471,7 +471,7 @@ Once the server is set up, _on your local laptop or desktop_, make sure you can ```bash $ curl https://your-lhci-server.example.com/version # Make sure you can connect to your server. 0.x.x -$ npm install -g @lhci/cli@0.8.x # Install the Lighthouse CI CLI. +$ npm install -g @lhci/cli@0.11.x # Install the Lighthouse CI CLI. Installing... $ lhci wizard # Use the wizard to create a project. ? Which wizard do you want to run? new-project diff --git a/docs/troubleshooting.md b/docs/troubleshooting.md index f93dbbb5d..4142b2618 100644 --- a/docs/troubleshooting.md +++ b/docs/troubleshooting.md @@ -80,7 +80,7 @@ The team does not have the bandwidth to assist with debugging this problem. Plea ## Running LHCI in Github Actions I constantly get Ancestor hash not determinable -If you are using `actions/checkout@v2` to checkout your repository and based on the size and traffic on your repo this error might happen due to how the checkout action is configured and is not a LHCI issue. +If you are using `actions/checkout@v3` to checkout your repository and based on the size and traffic on your repo this error might happen due to how the checkout action is configured and is not a LHCI issue. Checkout action by default doesn't clone the entire repo and the number of commits to fetch is set to 1 for performance reasons. When LHCI runs the health check the ancestor hash might be missing because the branch / hash is not there in the local history. @@ -93,13 +93,13 @@ jobs: name: Lighthouse runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: fetch-depth: 20 - name: Fetch base_ref HEAD to use it as Ancestor hash in LHCI run: git fetch --depth=1 origin +refs/heads/${{github.base_ref}}:refs/remotes/origin/${{github.base_ref}} ``` -The additions are `fetch-depth: 20` added to `actions/checkout@v2` and a new step to fetch base_ref HEAD to use it as ancestor hash in LHCI. +The additions are `fetch-depth: 20` added to `actions/checkout@v3` and a new step to fetch base_ref HEAD to use it as ancestor hash in LHCI. The fetch depth set to 20 is a good default, but might not work in all cases, you can adjust it based on your needs.