-
Notifications
You must be signed in to change notification settings - Fork 204
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
Collect lighthouse CI on each frontend change #4994
Changes from all commits
9217da1
2782e15
7c5527d
32de0dd
81b4b26
494d524
6471d9e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
ci: | ||
collect: | ||
url: | ||
- http://127.0.0.1:8443/ | ||
startServerCommand: "just p frontend start" | ||
startServerReadyPattern: "Listening on http" | ||
upload: | ||
# temporary target until either temporary-public-storage is back | ||
# (https://github.com/GoogleChrome/lighthouse-ci/issues/1072) | ||
# or we spin up our own Openverse lhci server | ||
target: "filesystem" |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1014,6 +1014,43 @@ jobs: | |
issue-number: ${{ github.event.pull_request.number }} | ||
body: ${{ steps.help-body.outputs.help_body }} | ||
|
||
lighthouse-ci: | ||
name: Collect Lighthouse CI results | ||
runs-on: ubuntu-latest | ||
needs: | ||
- nuxt-build | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup CI env | ||
uses: ./.github/actions/setup-env | ||
with: | ||
setup_python: false | ||
install_recipe: node-install | ||
|
||
- name: Run build | ||
run: just frontend/run build | ||
env: | ||
DEPLOYMENT_ENV: production | ||
NODE_ENV: production | ||
|
||
- name: Run Lighthouse CI | ||
id: lhci-autorun | ||
# Lighthouse CI runs the webserver for us, as configured in lighthouserc | ||
env: | ||
NODE_ENV: production | ||
run: | | ||
pnpm --package=@lhci/cli dlx lhci autorun --config .github/.lighthouserc.yml | ||
|
||
- name: Display Report | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would it be possible to add it as a comment on the PR? Or do you think that would be too much? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There are other actions out there that generate markdown tables, but they all looked pretty bad (too information dense) and the comments would be very long (similar to the old bundle size comments). I think we should think of ways of making the results more noticeable, but those would probably come more from writing assertions so that the check fails when we get results we don't want. Lighthouse CI recommends you wait to add assertions until after you've had a chance to understand your results and make changes to improve them a bit first. Ultimately, I think this action would be the best thing, once we are comfortable in our understanding of what we want from Lighthouse. That action requires setting up access to S3 for saving the files, which I'd prefer to do as a separate step to this one of just getting it running. |
||
if: always() | ||
uses: jackywithawhitedog/lighthouse-viewer-action@v2 | ||
with: | ||
resultsPath: .lighthouseci | ||
lighthouseOutcome: ${{ steps.lhci-autorun.outcome }} | ||
|
||
################# | ||
# Documentation # | ||
################# | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we reuse the built Nuxt app for this and for the k6?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We would need to push the
.nuxt
directory as an artifact, I think, but it should be possible. It only takes 32-seconds though. Downloading and decompressing the artifact could take just as long.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Building makes more sense, considering the time it takes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nuxt 3 made it a lot better 🙂