Skip to content
Open
16 changes: 8 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ jobs:
YARN_GPG: 'no'
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Use Node.js 18
uses: actions/setup-node@v3
- name: Use Node.js 24
uses: actions/setup-node@v6
with:
node-version: 18
node-version: 24
cache: yarn
- run: yarn install --frozen-lockfile
- run: yarn build
Expand Down Expand Up @@ -68,13 +68,13 @@ jobs:
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Use Node.js 18
uses: actions/setup-node@v3
- name: Use Node.js 24
uses: actions/setup-node@v6
with:
node-version: 18
node-version: 24
cache: yarn
# Since Ubuntu 23, dev builds of Chromium need this.
# https://chromium.googlesource.com/chromium/src/+/main/docs/security/apparmor-userns-restrictions.md
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ jobs:
lighthouseci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: 18
node-version: 24
- run: npm install && npm install -g @lhci/cli@0.15.x
- run: npm run build
- run: lhci autorun
Expand Down
55 changes: 44 additions & 11 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
- [Modifications for Sites without a Build Step](#modifications-for-sites-without-a-build-step)
- [Modifications for Sites with a Custom Server](#modifications-for-sites-with-a-custom-server)
- [GitHub Status Checks](#github-status-checks)
- [GitHub App Method (Recommended)](#github-app-method-recommended)
- [GitHub Automatic Token (Recommended)](#github-automatic-token-recommended)
- [Alternative: GitHub App Method](#alternative-github-app-method)
- [Alternative: Personal Access Token Method](#alternative-personal-access-token-method)
- [Additional configuration for GitHub Actions as CI Provider](#additional-configuration-for-github-actions-as-ci-provider)
- [Add Assertions](#add-assertions)
Expand Down Expand Up @@ -84,11 +85,11 @@ jobs:
name: Lighthouse
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js 16.x
uses: actions/setup-node@v3
- uses: actions/checkout@v6
- name: Use Node.js 24.x
uses: actions/setup-node@v6
with:
node-version: 16.x
node-version: 24.x
- name: npm install, build
run: |
npm install
Expand Down Expand Up @@ -198,7 +199,7 @@ echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" | sud
wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | sudo apt-key add -

# Add Node's apt-key
curl -sL https://deb.nodesource.com/setup_16.x | sudo -E bash -
curl -sL https://deb.nodesource.com/setup_24.x | sudo -E bash -

# Install NodeJS and Google Chrome
sudo apt-get update
Expand Down Expand Up @@ -334,7 +335,39 @@ GitHub status checks add additional granularity to your build reporting and dire

![screenshot of GitHub status checks for Lighthouse CI](https://user-images.githubusercontent.com/2301202/68001177-0b9dd180-fc31-11e9-8091-ada8c6e50a9b.png)

#### GitHub App Method (Recommended)
#### GitHub Automatic Token (Recommended)

The easiest and most secure way to add status checks to your PR is via the [automatic GITHUB_TOKEN](https://docs.github.com/en/actions/tutorials/authenticate-with-github_token). You need to make sure it has both `contents:read` and `statuses:write` permissions.

```diff
name: CI
on: [push]
jobs:
lhci:
name: Lighthouse
runs-on: ubuntu-latest
+ permissions:
+ contents: read
+ statuses: write
steps:
- uses: actions/checkout@v6
- name: Use Node.js 24.x
uses: actions/setup-node@v6
with:
node-version: 24.x
- name: npm install, build
run: |
npm install
npm run build
- name: run Lighthouse CI
run: |
npm install -g @lhci/cli@0.15.x
lhci autorun
+ env:
+ LHCI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
```

#### Alternative: GitHub App Method

**NOTE: Before installing the GitHub App, refer to the [terms of service](./services-disclaimer.md#github-app).**

Expand All @@ -360,13 +393,13 @@ jobs:
name: Lighthouse
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v6
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Use Node.js 16.x
uses: actions/setup-node@v3
- name: Use Node.js 24.x
uses: actions/setup-node@v6
with:
node-version: 16.x
node-version: 24.x
- name: npm install, build
run: |
npm install
Expand Down
2 changes: 1 addition & 1 deletion docs/recipes/docker-client/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:18-bullseye-slim
FROM node:24-bullseye-slim

# Set variable so puppeteer will not try to download chromium
ENV PUPPETEER_SKIP_DOWNLOAD=true
Expand Down
2 changes: 1 addition & 1 deletion docs/recipes/docker-server/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:18-bullseye-slim
FROM node:24-bullseye-slim

# Install utilities
RUN apt-get update --fix-missing && apt-get install -y python build-essential && apt-get clean
Expand Down
2 changes: 2 additions & 0 deletions docs/recipes/heroku-server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ This assumes you've already signed up, created a heroku account, and installed t
```bash
# Create a new project on heroku
heroku create
# Setup the Heroku git remote
heroku git:remote -a <project-name-from-above>
# Add a database to your project
heroku addons:create heroku-postgresql:essential-0
# Deploy your code to heroku
Expand Down
2 changes: 1 addition & 1 deletion docs/recipes/heroku-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
"pg-hstore": "^2.3.3"
},
"engines": {
"node": "18.x"
"node": "24.x"
}
}
6 changes: 3 additions & 3 deletions docs/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -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@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.
If you are using `actions/checkout@v6` 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.

Expand All @@ -93,13 +93,13 @@ jobs:
name: Lighthouse
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v6
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@v3` 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@v6` 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.