TextSearch

CircleCI Developer Hub - orbies/lighthouse-ci

Circle CI jobs for Lighthouse CI

· archived 5/18/2026, 12:39:38 AMscreenshotcached html
CircleCI Developer Hub - orbies/lighthouse-ciDeveloperStart Building for FreeHomeDocsOrbsImagesCircleCI.comAcademyBlogCommunitySupportOrb Quick Start GuideCommandsrun_lhci_collectvalidate_test_exit_codesrun_lhci_assert_and_uploadOrb SourceOrbsorbies/[email protected]/[email protected] this OrbSectionsCircle CI jobs for Lighthouse CICreated: September 7, 2020Version Published: July 16, 2021Releases: 8Org Usage: < 25See Orb LicensingOrb Quick Start GuideUse CircleCI version 2.1 at the top of your .circleci/config.yml file.version: 2.1Copy This CodeAdd the orbs stanza below your version, invoking the orb:orbs: lighthouse-ci: orbies/[email protected] This CodeUse lighthouse-ci elements in your existing workflows and jobs.Opt-in to use of uncertified orbs on your organization’s Security settings page.Read more in the docs here.Commandsrun_lhci_collect Show command SourcePARAMETERDESCRIPTIONREQUIREDDEFAULTTYPEpath_to_config_template-Yes-stringhost_name-Yes-stringbuild_token-Yes-stringgithub_token-Yes-stringuser-Yes-stringpassword-Yes-stringclone-Nomoteefestringvalidate_test_exit_codeschecks the exit codes from the tests executions, only in one of the nodes Show command SourcePARAMETERDESCRIPTIONREQUIREDDEFAULTTYPEclone-Nomoteefestringrun_lhci_assert_and_upload Show command SourcePARAMETERDESCRIPTIONREQUIREDDEFAULTTYPEproject-Yes-stringclone-NomoteefestringOrb Source1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 # This code is licensed from CircleCI to the user under the MIT license. # See here for details: https://circleci.com/developer/orbs/licensing version: 2.1 description: Circle CI jobs for Lighthouse CI orbs: aws-cli: circleci/[email protected] aliases: - &lhci_install name: Install lhci command: | echo 'export PATH=$(yarn global bin):$PATH' >> $BASH_ENV source $BASH_ENV yarn global add @lhci/cli@^0.5.0 commands: run_lhci_collect: parameters: path_to_config_template: type: string host_name: type: string build_token: type: string github_token: type: string user: type: string password: type: string clone: type: string default: moteefe steps: - run: name: Generate Lighthouse CI config to lighthouserc.yml from the template command: | export LHCI_HOST_NAME=<< parameters.host_name >> export LHCI_USER=<< parameters.user >> export LHCI_PASSWORD=<< parameters.password >> export LHCI_BUILD_TOKEN=<< parameters.build_token >> export LHCI_GITHUB_TOKEN=<< parameters.github_token >> mkdir -p /tmp/output/exit_codes_for_nodes eval "cat \<< EOF $(< << parameters.path_to_config_template >>) EOF" > ./lighthouserc.yml - run: *lhci_install - aws-cli/setup - run: name: Collect lhci and create file with exit code for node command: | lhci collect --settings.chromeFlags='--disable-dev-shm-usage'; \ echo $? >> /tmp/output/exit_codes_for_nodes/exit_codes_for_node_${CIRCLE_NODE_INDEX} aws s3 cp /tmp/output/exit_codes_for_nodes s3://${AWS_S3_BUCKET}/test-reports-circle/lhci/${CIRCLE_PROJECT_REPONAME}/${CIRCLE_BRANCH}/<< parameters.clone >>/${CIRCLE_BUILD_NUM}/output --recursive validate_test_exit_codes: description: checks the exit codes from the tests executions, only in one of the nodes parameters: clone: type: string default: moteefe steps: - run: name: "Check exit codes from other jobs" shell: /bin/sh command: | if [ $CIRCLE_NODE_INDEX -ne 0 ]; then echo "Only the node 0 will create the report for the tests. Will skip for this node ${CIRCLE_NODE_INDEX}." circleci step halt else retries=0 until [ $((++retries)) -ge 200 ]; do number_of_exit_codes=$(aws s3api list-objects --bucket ${AWS_S3_BUCKET} --prefix test-reports-circle/lhci/${CIRCLE_PROJECT_REPONAME}/${CIRCLE_BRANCH}/<< parameters.clone >>/${CIRCLE_BUILD_NUM}/output/exit_codes_for_node_ --query "[length(Contents[])]" --output text) if [ $number_of_exit_codes -eq $CIRCLE_NODE_TOTAL ]; then break fi echo $number_of_exit_codes sleep 5 done fi run_lhci_assert_and_upload: parameters: project: type: string clone: type: string default: moteefe steps: - run: *lhci_install - aws-cli/setup - run: name: restore tests output from s3 command: | aws s3 cp s3://${AWS_S3_BUCKET}/test-reports-circle/${CIRCLE_PROJECT_REPONAME}/${CIRCLE_BRANCH}/<< parameters.clone >>/${CIRCLE_BUILD_NUM}/output \ ~/lhci/.lighthouseci \ --recursive - run: name: Run lhci assert command: lhci assert - run: name: Copy lighthouse reports command: | mkdir -p /tmp/reports cp ~/lhci/.lighthouseci/lhr-*.html /tmp/reports - run: name: Create link to lhci report command: | mkdir -p /tmp/reports LHCI_SERVER_BASE_URL=$(npx --yes -q js-yaml ~/lhci/lighthouserc.yml | node -e "console.log(JSON.parse(require('fs').readFileSync(0).toString()).ci.upload.serverBaseUrl )") LHCI_PROJECT=<< parameters.project >> echo "<html><script>location.replace('${LHCI_SERVER_BASE_URL}app/projects/${LHCI_PROJECT}/dashboard?branch=${CIRCLE_BRANCH}')</script></html>" > ./report.html cp ./report.html /tmp/reports - store_artifacts: path: /tmp/reports destination: lhci - run: name: Run lhci upload command: lhci upload Developer UpdatesGet tips to optimize your buildsOr join our research panel and give feedbackCountryUnited StatesCanada----AndorraUnited Arab EmiratesAfghanistanAntigua and BarbudaAnguillaAlbaniaArmeniaAngolaAntarcticaArgentinaAustriaAustraliaArubaAland IslandsAzerbaijanBosnia and HerzegovinaBarbadosBangladeshBelgiumBurkina FasoBulgariaBahrainBurundiBeninSaint BarthélemyBermudaBrunei DarussalamBolivia, Plurinational State ofBonaire, Sint Eustatius and SabaBrazilBahamasBhutanBouvet IslandBotswanaBelarusBelizeCanadaCocos (Keeling) IslandsCongo, the Democratic Republic of theCentral African RepublicCongoSwitzerlandCôte d’IvoireCook IslandsChileCameroonChinaColombiaCosta RicaCubaCape VerdeCuraçaoChristmas IslandCyprusCzech RepublicGermanyDjiboutiDenmarkDominicaDominican RepublicAlgeriaEcuadorEstoniaEgyptWestern SaharaEritreaSpainEthiopiaFinlandFijiFalkland Islands (Malvinas)Faroe IslandsFranceGabonUnited KingdomGrenadaGeorgiaFrench GuianaGuernseyGhanaGibraltarGreenlandGambiaGuineaGuadeloupeEquatorial GuineaGreeceSouth Georgia and the South Sandwich IslandsGuatemalaGuinea-BissauGuyanaHeard Island and McDonald IslandsHondurasCroatiaHaitiHungaryIndonesiaIrelandIsraelIsle of ManIndiaBritish Indian Ocean TerritoryIraqIran, Islamic Republic ofIcelandItalyJerseyJamaicaJordanJapanKenyaKyrgyzstanCambodiaKiribatiComorosSaint Kitts and NevisKorea, Democratic People’s Republic ofKorea, Republic ofKuwaitCayman IslandsKazakhstanLao People’s Democratic RepublicLebanonSaint LuciaLiechtensteinSri LankaLiberiaLesothoLithuaniaLuxembourgLatviaLibyan Arab JamahiriyaMoroccoMonacoMoldova, Republic ofMontenegroSaint Martin (French part)MadagascarNorth Macedonia, Republic ofMaliMyanmarMongoliaMacaoMartiniqueMauritaniaMontserratMaltaMauritiusMaldivesMalawiMexicoMalaysiaMozambiqueNamibiaNew CaledoniaNigerNorfolk IslandNigeriaNicaraguaNetherlandsNorwayNepalNauruNiueNew ZealandOmanPanamaPeruFrench PolynesiaPapua New GuineaPhilippinesPakistanPolandSaint Pierre and MiquelonPitcairnPalestinePortugalParaguayQatarRéunionRomaniaSerbiaRussian FederationRwandaSaudi ArabiaSolomon IslandsSeychellesSudanSwedenSingaporeSaint Helena, Ascension and Tristan da CunhaSloveniaSvalbard and Jan MayenSlovakiaSierra LeoneSan MarinoSenegalSomaliaSurinameSouth SudanSao Tome and PrincipeEl SalvadorSint Maarten (Dutch part)Syrian Arab RepublicSwazilandTurks and Caicos IslandsChadFrench Southern TerritoriesTogoThailandTajikistanTokelauTimor-LesteTurkmenistanTunisiaTongaTurkeyTrinidad and TobagoTuvaluTaiwanTanzania, United Republic ofUkraineUgandaUnited StatesUruguayUzbekistanHoly See (Vatican City State)Saint Vincent and the GrenadinesVenezuela, Bolivarian Republic ofVirgin Islands, BritishVietnamVanuatuWallis and FutunaSamoaYemenMayotteSouth AfricaZambiaZimbabweSubscribeBy submitting this form, you are agreeing to ourTerms of UseandPrivacy Policy.DeveloperCircleCI RSS feedCircleCI FacebookCircleCI TwitterCircleCI GitHubCircleCI TwitchCircleCI LinkedInTerms of UsePrivacy PolicyCookie PolicySecurity© 2023 Circle Internet Services, Inc., All Rights Reserved.