From 5675c1a9e76aa8723df266f1b7f2093b3b4f206d Mon Sep 17 00:00:00 2001 From: RyosukeCla Date: Thu, 23 Aug 2018 12:19:33 +0900 Subject: [PATCH 1/6] install lighthouse and add lighthouse script --- package-lock.json | 17 +++++++++++++++++ package.json | 3 +++ 2 files changed, 20 insertions(+) diff --git a/package-lock.json b/package-lock.json index fc7416781..00d4e95b0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12423,6 +12423,23 @@ "type-check": "~0.3.2" } }, + "lighthouse-ci": { + "version": "git+https://github.com/ebidel/lighthouse-ci.git#bafe19ab8c9a593dac98d9900cffea97a1327811", + "from": "git+https://github.com/ebidel/lighthouse-ci.git", + "dev": true, + "requires": { + "minimist": "^1.2.0", + "node-fetch": "^1.7.3" + }, + "dependencies": { + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "dev": true + } + } + }, "load-json-file": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", diff --git a/package.json b/package.json index 8790f4e9b..89cbf5390 100644 --- a/package.json +++ b/package.json @@ -36,6 +36,8 @@ "start:offload": "cross-env ENABLE_OFFLOAD=1 npm run start:dev", "start:prod": "cross-env NODE_ENV=production run-p start:{prod:server,dev:agreed}", "start:prod:server": "node bin/start-server.js", + "lighthouse": "run-p -r start:dev lighthouse:wait-on", + "lighthouse:wait-on": "wait-on tcp:3000 && lighthouse-ci http://localhost:3000", "storybook": "start-storybook -p 6006", "test": "run-p test:agreed test:wait-on -r", "test:agreed": "agreed-server --path ./spec/agreed/agreed.js --port 3020", @@ -142,6 +144,7 @@ "flow-bin": "^0.78.0", "form-data": "^2.3.1", "jest": "^23.4.1", + "lighthouse-ci": "git+https://github.com/ebidel/lighthouse-ci.git", "mkdirp": "^0.5.1", "npm-run-all": "^4.0.2", "power-assert": "^1.6.0", From 5161bb32f7e88bfb04d229b2658425f77282f70b Mon Sep 17 00:00:00 2001 From: RyosukeCla Date: Thu, 23 Aug 2018 12:19:49 +0900 Subject: [PATCH 2/6] add llighthouse to circle.config --- .circleci/config.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 74f247529..04449ac39 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -109,6 +109,11 @@ jobs: - <<: *restore - <<: *restore_lock - run: npm run build-storybook + lighthouse: + <<: *build_image + steps: + - <<: *restore + - run: npm run lighthouse workflows: version: 2 @@ -144,3 +149,6 @@ workflows: - build-asset - build-storybook - test + - lighthouse: + requires: + - lighthouse From 44ea6c25b796f273bbbda822ecbe4ade7b2e4100 Mon Sep 17 00:00:00 2001 From: RyosukeCla Date: Thu, 23 Aug 2018 13:19:40 +0900 Subject: [PATCH 3/6] fix config.yml --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 04449ac39..df5ede9b3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -151,4 +151,4 @@ workflows: - test - lighthouse: requires: - - lighthouse + - install \ No newline at end of file From 82667727b41c26a2b24e5da75494dbb8241fe0a1 Mon Sep 17 00:00:00 2001 From: RyosukeCla Date: Thu, 23 Aug 2018 13:32:19 +0900 Subject: [PATCH 4/6] add TRAVIS_PULL_REQ_SLUG for lighthouse --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 89cbf5390..56daaa527 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,7 @@ "start:prod": "cross-env NODE_ENV=production run-p start:{prod:server,dev:agreed}", "start:prod:server": "node bin/start-server.js", "lighthouse": "run-p -r start:dev lighthouse:wait-on", - "lighthouse:wait-on": "wait-on tcp:3000 && lighthouse-ci http://localhost:3000", + "lighthouse:wait-on": "wait-on tcp:3000 && TRAVIS_PULL_REQUEST_SLUG=recruit-tech/redux-pluto lighthouse-ci http://localhost:3000", "storybook": "start-storybook -p 6006", "test": "run-p test:agreed test:wait-on -r", "test:agreed": "agreed-server --path ./spec/agreed/agreed.js --port 3020", From 805cfc3e5255c654000a383a162a2756be214339 Mon Sep 17 00:00:00 2001 From: RyosukeCla Date: Thu, 23 Aug 2018 14:43:08 +0900 Subject: [PATCH 5/6] add TRAVIS_EVENT_TYPE for lighthouse --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 56daaa527..2d4bfe200 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,7 @@ "start:prod": "cross-env NODE_ENV=production run-p start:{prod:server,dev:agreed}", "start:prod:server": "node bin/start-server.js", "lighthouse": "run-p -r start:dev lighthouse:wait-on", - "lighthouse:wait-on": "wait-on tcp:3000 && TRAVIS_PULL_REQUEST_SLUG=recruit-tech/redux-pluto lighthouse-ci http://localhost:3000", + "lighthouse:wait-on": "wait-on tcp:3000 && TRAVIS_PULL_REQUEST_SLUG=recruit-tech/redux-pluto TRAVIS_EVENT_TYPE=pull_request lighthouse-ci http://localhost:3000", "storybook": "start-storybook -p 6006", "test": "run-p test:agreed test:wait-on -r", "test:agreed": "agreed-server --path ./spec/agreed/agreed.js --port 3020", From c2a5719beba8ecfda03fb2301a3b480b08a7db14 Mon Sep 17 00:00:00 2001 From: RyosukeCla Date: Thu, 23 Aug 2018 14:59:44 +0900 Subject: [PATCH 6/6] empty commit for circleci