Skip to content

Commit

Permalink
chore(ci): updates lighthouse and configuration thereof
Browse files Browse the repository at this point in the history
  • Loading branch information
dgrebb committed Oct 18, 2023
1 parent 8d69bc6 commit d5ea0b1
Show file tree
Hide file tree
Showing 26 changed files with 263 additions and 135 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/bd-fe.yml
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ jobs:
- name: ↕ Sync S3
uses: jakejarvis/s3-sync-action@master
with:
args: --acl public-read --follow-symlinks --delete --cache-control max-age=2853213,public
args: --acl public-read --follow-symlinks --delete --cache-control max-age=8380800,public
env:
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-backstop-refs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
run: cd _ci/backstop && npm ci

- name: 🔥 Warm Cache
run: ./_ci/_utils/warmup.sh
run: ./_ci/_utils/warmup.sh ${{ github.ref_name == 'main' && 'prd' || 'stg' }}

- name: 📸 Capturing References
id: backstop
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-backstop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
run: cd _ci/backstop && npm ci && npx playwright install --with-deps

- name: 🔥 Warmup Cache
run: ./_ci/_utils/warmup.sh
run: ./_ci/_utils/warmup.sh ${{ github.ref_name == 'main' && 'prd' || 'stg' }}

- name: 👀 Testing Bitmaps
id: backstop
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/test-lighthouse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,11 @@ jobs:
- name: 🌤️ Warmup CloudFront Cache
run: |
_ci/_utils/warmup.sh
_ci/_utils/warmup.sh ${{ github.ref_name == 'main' && 'prd' || 'stg' }}
- name: 🔦 Lighthouse
id: lighthouse
continue-on-error: true
run: |
cd _ci/perf/lighthouse
urls="${{ vars.LIGHTHOUSE_URLS }}"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-psi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
- name: 🌤️ Warmup CloudFront Cache
run: |
_ci/_utils/warmup.sh
_ci/_utils/warmup.sh ${{ github.ref_name == 'main' && 'prd' || 'stg' }}
- name: PageSpeed Insights Mobile
id: psim
Expand Down
4 changes: 3 additions & 1 deletion _ci/_utils/warmup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ warmUp() {
# If there are particular subdirectories in your sitemap that you do not wish to parse
# (i.e. because they cannot be cached), you can use the following regex:
# grep -oP "https?://$1\/((?!subdirectory))[^<]*"
wget --user-agent="$USERAGENT" -q "https://$1/sitemap.xml" --output-document - | egrep -o "https?://$1[^<]+" | wget -i -
# wget --user-agent="$USERAGENT" -q "https://$1/sitemap.xml" --output-document - | egrep -o "https?://$1[^<]+" | wget -i -
# NOTE: updated to include automation querystring
wget --user-agent="$USERAGENT" -q "https://$1/sitemap.xml" --output-document - | egrep -o "https?://$1[^<]+" | sed 's/$/\?roboto/' | wget -i -
}

if [ $# -eq 0 ]; then
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = {
const config = {
extends: "lighthouse:default",
settings: {
psiToken: process.env.PSI_APIKEY,
Expand All @@ -18,7 +18,15 @@ module.exports = {
deviceScaleFactor: 1,
disabled: false,
},
skipAudits: [
// Skip the h2 audit so it doesn't lie to us. See https://github.com/GoogleChrome/lighthouse/issues/6539
"uses-http2",
// There are always bf-cache failures when testing in headless. Reenable when headless can give us realistic bf-cache insights.
"bf-cache",
],
emulatedUserAgent:
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36",
},
};

export default config;
6 changes: 0 additions & 6 deletions _ci/perf/lighthouse/.lighthouserc.mobile.cjs

This file was deleted.

15 changes: 15 additions & 0 deletions _ci/perf/lighthouse/.lighthouserc.mobile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
const config = {
extends: "lighthouse:default",
settings: {
maxWaitForFcp: 15 * 1000,
maxWaitForLoad: 35 * 1000,
skipAudits: [
// Skip the h2 audit so it doesn't lie to us. See https://github.com/GoogleChrome/lighthouse/issues/6539
"uses-http2",
// There are always bf-cache failures when testing in headless. Reenable when headless can give us realistic bf-cache insights.
"bf-cache",
],
},
};

export default config;
Loading

0 comments on commit d5ea0b1

Please sign in to comment.