Skip to content
Open
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 21 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
# Javascript Node CircleCI 2.0 configuration file
# Javascript Node CircleCI 2.1 configuration file
#
# Check https://circleci.com/docs/2.0/language-javascript/ for more details
# Check https://circleci.com/docs/language-javascript for more details
#
version: 2
version: 2.1
orbs:
browser-tools: circleci/browser-tools@1.4.0
jobs:
build:
docker:
# specify the version you desire here
- image: circleci/node:10.15
working_directory: ~/repo
steps:
- checkout
- checkout

- browser-tools/install-chrome

# Download and cache dependencies
- restore_cache:
Expand All @@ -26,6 +30,19 @@ jobs:

- run: make build RELEASE_BRANCH=${CIRCLE_BRANCH}

- run:
name: run Lighthouse CI
command: |
sudo npm install -g @lhci/cli
lhci autorun || echo "LHCI failed!"
environment:
# LHCI_SERVER_BASE_URL, LHCI_SERVER_USERNAME, LHCI_SERVER_PASSWORD, LHCI_TOKEN,
# is defined in Environment Variables of circleci project
LHCI_SERVER_BASE_URL=${LHCI_SERVER_BASE_URL}
LHCI_USERNAME=${LHCI_SERVER_USERNAME}
LHCI_PASSWORD=${LHCI_SERVER_PASSWORD}
LHCI_TOKEN=${LHCI_TOKEN}

- run: rm -rf node_modules

# Download and cache dependencies for running
Expand Down Expand Up @@ -157,7 +174,6 @@ jobs:
kubectl rollout status deployment/${DEPLOYMENT} -n $CLUSTER_NAMESPACE

workflows:
version: 2
build_and_deploy:
jobs:
- build:
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,6 @@ yarn-error.log

#Ignore testing screenshots
src/test/screenshots/testDir/

#Ignore files after running lighthouse CI locally
.lighthouseci/
21 changes: 21 additions & 0 deletions lighthouserc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
module.exports = {
ci: {
collect: {
numberOfRuns: 5,
url: [
'http://localhost:3000/',
'http://localhost:3000/a/russian-invasion-of-ukraine-2022-kid-frequently-asked-questions',
],
startServerCommand: 'make dev',
},
upload: {
target: 'lhci',
serverBaseUrl: process.env.LHCI_SERVER_BASE_URL,
token: process.env.LHCI_TOKEN,
basicAuth: {
username: process.env.LHCI_USERNAME,
password: process.env.LHCI_PASSWORD,
},
},
},
}
Loading