Skip to content

Commit

Permalink
Allow to pass custom LHCI config
Browse files Browse the repository at this point in the history
The path of the custom config file is not yet configurable and needs to be
'.github/lighthouserc-custom.yml'.
  • Loading branch information
szimek committed Oct 25, 2021
1 parent 0ba9164 commit 386ebb6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ query_string="?_fd=0&pb=0"
min_score_performance="${LHCI_MIN_SCORE_PERFORMANCE:-0.6}"
min_score_accessibility="${LHCI_MIN_SCORE_ACCESSIBILITY:-0.9}"

# Prepare the default CI Lighthouse config
cat <<- EOF > lighthouserc.yml
ci:
collect:
Expand Down Expand Up @@ -195,6 +196,11 @@ ci:
aggregationMethod: median-run
EOF

# Merge custom Lighthouse CI config, if provided
if [[ -f ".github/lighthouserc-custom.yml" ]]; then
yq eval-all 'select(fileIndex == 0) * select(fileIndex == 1)' lighthouserc.yml .github/lighthouserc-custom.yml -i
fi

cat <<-EOF > setPreviewCookies.js
module.exports = async (browser) => {
// launch browser for LHCI
Expand Down

0 comments on commit 386ebb6

Please sign in to comment.