forked from sourcegraph/sourcegraph-public-snapshot
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Performance: Add Lighthouse CI (sourcegraph#25455)
- Loading branch information
Showing
9 changed files
with
607 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
BASE_URL=http://localhost:3443 | ||
TEST_LABEL=$1 | ||
TEST_PATH=$2 | ||
|
||
# Store results on `main` so future branches can be compared against a baseline | ||
[[ "$BUILDKITE_BRANCH" == "main" ]] && SHOULD_STORE_RESULTS='true' || SHOULD_STORE_RESULTS='false' | ||
|
||
echo "--- Download pre-built client artifact" | ||
buildkite-agent artifact download 'client.tar.gz' . --step 'lighthouse:prep' | ||
tar -xf client.tar.gz -C . | ||
|
||
echo "--- Yarn install in root" | ||
# mutex is necessary since CI runs various yarn installs in parallel | ||
NODE_ENV='' yarn --mutex network --frozen-lockfile --network-timeout 60000 | ||
|
||
echo "--- Collecting Lighthouse results" | ||
yarn lhci collect --url="$BASE_URL$TEST_PATH" | ||
|
||
echo "--- Uploading Lighthouse results" | ||
yarn lhci upload --githubStatusContextSuffix="/$TEST_LABEL" --uploadUrlMap="$SHOULD_STORE_RESULTS" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// @ts-check | ||
|
||
const config = { | ||
ci: { | ||
collect: { | ||
// Note: We override this URL in CI through ./dev/ci/yarn-lighthouse.sh | ||
url: 'http://localhost:3443/', | ||
startServerCommand: 'yarn workspace @sourcegraph/web serve:prod', | ||
settings: { | ||
preset: 'desktop', | ||
chromeFlags: '--no-sandbox', | ||
// We skip a series of audits that are not currently supported by the local server | ||
skipAudits: [ | ||
// SEO: Normally enabled dynamically for different paths in the production server | ||
'meta-description', | ||
// Best practices: HTTPS currently disabled in local server: https://github.com/sourcegraph/sourcegraph/issues/21869 | ||
'is-on-https', | ||
'uses-http2', | ||
// SEO: Robots.txt file isn't served locally | ||
'robots-txt', | ||
], | ||
}, | ||
}, | ||
upload: { | ||
target: 'temporary-public-storage', | ||
}, | ||
}, | ||
} | ||
|
||
module.exports = config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.