Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use current versions on GitHub Actions, LHCI and Node #817

Merged
merged 4 commits into from
Mar 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
Expand Down
4 changes: 2 additions & 2 deletions docs/complex-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down
24 changes: 12 additions & 12 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
```

Expand All @@ -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
Expand Down Expand Up @@ -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
```

Expand Down Expand Up @@ -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!"
```

Expand Down Expand Up @@ -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
```

Expand Down Expand Up @@ -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'

Expand Down Expand Up @@ -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
Expand All @@ -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 }}
Expand Down Expand Up @@ -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
Expand Down
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@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.

Expand All @@ -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.