From 615927f3f20562f97a35c291f75a7d204c37e401 Mon Sep 17 00:00:00 2001 From: rschamp Date: Tue, 13 Aug 2019 16:47:44 -0400 Subject: [PATCH 01/32] Add initial CircleCI config --- .circleci/config.yml | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 000000000..8b1d039dc --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,43 @@ +# Javascript Node CircleCI 2.0 configuration file +# +# Check https://circleci.com/docs/2.0/language-javascript/ for more details +# +version: 2 +jobs: + build: + docker: + - image: circleci/node:8.16-browsers + + working_directory: ~/repo + + steps: + - checkout + + # Download and cache dependencies + - restore_cache: + keys: + - v1-dependencies-{{ checksum "package-lock.json" }} + # fallback to using the latest cache if no exact match is found + - v1-dependencies- + + - run: + name: Install greenkeeper-lockfile + command: sudo npm install -g greenkeeper-lockfile + - run: + name: Install dependencies + command: npm --production=false install + - run: + name: Run greenkeeper-lockfile-update + command: greenkeeper-lockfile-update + + - save_cache: + paths: + - node_modules + key: v1-dependencies-{{ checksum "package-lock.json" }} + + - run: + name: Run tests + command: npm test + - run: + name: Run greenkeeper-lockfile-upload + command: greenkeeper-lockfile-upload From 40a3b857dadd2b9dae298069105f9b5ee003b413 Mon Sep 17 00:00:00 2001 From: rschamp Date: Thu, 15 Aug 2019 16:22:10 -0400 Subject: [PATCH 02/32] Keep config-dependent environment vars in the config MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit NODE_ENV isn’t one we’d want to change dynamically, so keep it checked in to the config --- .circleci/config.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 8b1d039dc..ba2fed964 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -7,6 +7,9 @@ jobs: build: docker: - image: circleci/node:8.16-browsers + + environment: + NODE_ENV: production working_directory: ~/repo From 74b795ada870fe7e1455288a47aa0c4307215e2d Mon Sep 17 00:00:00 2001 From: rschamp Date: Thu, 15 Aug 2019 21:00:38 -0400 Subject: [PATCH 03/32] Reformat --- .circleci/config.yml | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ba2fed964..58f5ffd53 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -23,15 +23,9 @@ jobs: # fallback to using the latest cache if no exact match is found - v1-dependencies- - - run: - name: Install greenkeeper-lockfile - command: sudo npm install -g greenkeeper-lockfile - - run: - name: Install dependencies - command: npm --production=false install - - run: - name: Run greenkeeper-lockfile-update - command: greenkeeper-lockfile-update + - run: sudo npm install -g greenkeeper-lockfile + - run: npm --production=false install + - run: greenkeeper-lockfile-update - save_cache: paths: @@ -41,6 +35,4 @@ jobs: - run: name: Run tests command: npm test - - run: - name: Run greenkeeper-lockfile-upload - command: greenkeeper-lockfile-upload + - run: greenkeeper-lockfile-upload From 89918a304f691950106f3dd5edd27db6f4883262 Mon Sep 17 00:00:00 2001 From: rschamp Date: Thu, 15 Aug 2019 21:00:50 -0400 Subject: [PATCH 04/32] Try uploading lint results --- .circleci/config.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 58f5ffd53..cee89b50f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -33,6 +33,9 @@ jobs: key: v1-dependencies-{{ checksum "package-lock.json" }} - run: - name: Run tests - command: npm test + name: Lint + command: npm run test:lint -- --output-file test-results/eslint/results.xml --format junit + + - store_test_results: + path: test-results - run: greenkeeper-lockfile-upload From e3d4d6e9d7afbfff78b06c92befabbf4ad246be0 Mon Sep 17 00:00:00 2001 From: rschamp Date: Thu, 15 Aug 2019 21:07:33 -0400 Subject: [PATCH 05/32] =?UTF-8?q?Circle=20doesn=E2=80=99t=20know=20about?= =?UTF-8?q?=20eslint=20warnings?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit They show up as errors --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index cee89b50f..d42309f38 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -34,7 +34,7 @@ jobs: - run: name: Lint - command: npm run test:lint -- --output-file test-results/eslint/results.xml --format junit + command: npm run test:lint -- --quiet --output-file test-results/eslint/results.xml --format junit - store_test_results: path: test-results From 17154cefecbfa62671948bd5b58fe3108dec054d Mon Sep 17 00:00:00 2001 From: rschamp Date: Thu, 15 Aug 2019 22:40:23 -0400 Subject: [PATCH 06/32] Add back jest and build steps with reporting --- .circleci/config.yml | 18 ++++++- package-lock.json | 123 +++++++++++++++++++++++++++++++++++++++++++ package.json | 1 + 3 files changed, 141 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index d42309f38..07401631f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -10,7 +10,7 @@ jobs: environment: NODE_ENV: production - + JEST_JUNIT_OUTPUT_NAME: results.xml working_directory: ~/repo steps: @@ -35,6 +35,22 @@ jobs: - run: name: Lint command: npm run test:lint -- --quiet --output-file test-results/eslint/results.xml --format junit + + - run: + name: Unit + environment: + JEST_JUNIT_OUTPUT_DIR: test-results/unit + command: npm run test:unit -- --reporters="default" --reporters="jest-junit" + + - run: + name: Build + command: npm run build + + - run: + name: Integration + environment: + JEST_JUNIT_OUTPUT_DIR: test-results/integration + command: npm run test:integration -- --reporters="default" --reporters="jest-junit" - store_test_results: path: test-results diff --git a/package-lock.json b/package-lock.json index 0b40e7baa..c47006943 100644 --- a/package-lock.json +++ b/package-lock.json @@ -921,6 +921,17 @@ "to-fast-properties": "^2.0.0" } }, + "@jest/types": { + "version": "24.8.0", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-24.8.0.tgz", + "integrity": "sha512-g17UxVr2YfBtaMUxn9u/4+siG1ptg9IGYAYwvpwn61nBg779RXnjE/m7CxYcIzEt0AbHZZAHSEZNhkE2WxURVg==", + "dev": true, + "requires": { + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^1.1.1", + "@types/yargs": "^12.0.9" + } + }, "@scratch/paper": { "version": "0.11.20190729152410", "resolved": "https://registry.npmjs.org/@scratch/paper/-/paper-0.11.20190729152410.tgz", @@ -985,6 +996,31 @@ "@types/node": "*" } }, + "@types/istanbul-lib-coverage": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.1.tgz", + "integrity": "sha512-hRJD2ahnnpLgsj6KWMYSrmXkM3rm2Dl1qkx6IOFD5FnuNPXJIG5L0dhgKXCYTRMGzU4n0wImQ/xfmRc4POUFlg==", + "dev": true + }, + "@types/istanbul-lib-report": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-1.1.1.tgz", + "integrity": "sha512-3BUTyMzbZa2DtDI2BkERNC6jJw2Mr2Y0oGI7mRxYNBPxppbtEK1F66u3bKwU2g+wxwWI7PAoRpJnOY1grJqzHg==", + "dev": true, + "requires": { + "@types/istanbul-lib-coverage": "*" + } + }, + "@types/istanbul-reports": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-1.1.1.tgz", + "integrity": "sha512-UpYjBi8xefVChsCoBpKShdxTllC9pwISirfoZsUa2AAdQg/Jd2KQGtSbw+ya7GPo7x/wAPlH6JBhKhAsXUEZNA==", + "dev": true, + "requires": { + "@types/istanbul-lib-coverage": "*", + "@types/istanbul-lib-report": "*" + } + }, "@types/json-schema": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.3.tgz", @@ -1003,6 +1039,12 @@ "integrity": "sha512-dyYO+f6ihZEtNPDcWNR1fkoTDf3zAK3lAABDze3mz6POyIercH0lEUawUFXlG8xaQZmm1yEBON/4TsYv/laDYg==", "dev": true }, + "@types/yargs": { + "version": "12.0.12", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-12.0.12.tgz", + "integrity": "sha512-SOhuU4wNBxhhTHxYaiG5NY4HBhDIDnJF60GU+2LqHAdKKer86//e4yg69aENCtQ04n0ovz+tq2YPME5t5yp4pw==", + "dev": true + }, "@typescript-eslint/experimental-utils": { "version": "1.13.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-1.13.0.tgz", @@ -7779,6 +7821,81 @@ "p-cancelable": "^0.3.0" } }, + "jest-junit": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/jest-junit/-/jest-junit-7.0.0.tgz", + "integrity": "sha512-ljUdO0hLyu0A92xk7R2Wet3kj99fmazTo+ZFYQP6b7AGOBxJUj8ZkJWzJ632ajpXko2Y5oNoGR2kvOwiDdu6hg==", + "dev": true, + "requires": { + "jest-validate": "^24.0.0", + "mkdirp": "^0.5.1", + "strip-ansi": "^4.0.0", + "xml": "^1.0.1" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true + }, + "jest-get-type": { + "version": "24.8.0", + "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-24.8.0.tgz", + "integrity": "sha512-RR4fo8jEmMD9zSz2nLbs2j0zvPpk/KCEz3a62jJWbd2ayNo0cb+KFRxPHVhE4ZmgGJEQp0fosmNz84IfqM8cMQ==", + "dev": true + }, + "jest-validate": { + "version": "24.8.0", + "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-24.8.0.tgz", + "integrity": "sha512-+/N7VOEMW1Vzsrk3UWBDYTExTPwf68tavEPKDnJzrC6UlHtUDU/fuEdXqFoHzv9XnQ+zW6X3qMZhJ3YexfeLDA==", + "dev": true, + "requires": { + "@jest/types": "^24.8.0", + "camelcase": "^5.0.0", + "chalk": "^2.0.1", + "jest-get-type": "^24.8.0", + "leven": "^2.1.0", + "pretty-format": "^24.8.0" + } + }, + "pretty-format": { + "version": "24.8.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-24.8.0.tgz", + "integrity": "sha512-P952T7dkrDEplsR+TuY7q3VXDae5Sr7zmQb12JU/NDQa/3CH7/QW0yvqLcGN6jL+zQFKaoJcPc+yJxMTGmosqw==", + "dev": true, + "requires": { + "@jest/types": "^24.8.0", + "ansi-regex": "^4.0.0", + "ansi-styles": "^3.2.0", + "react-is": "^16.8.4" + } + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "^3.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + } + } + } + } + }, "jest-matcher-utils": { "version": "21.2.1", "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-21.2.1.tgz", @@ -14645,6 +14762,12 @@ } } }, + "xml": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/xml/-/xml-1.0.1.tgz", + "integrity": "sha1-eLpyAgApxbyHuKgaPPzXS0ovweU=", + "dev": true + }, "xml-name-validator": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-2.0.1.tgz", diff --git a/package.json b/package.json index 54671c9f6..d15e0f261 100644 --- a/package.json +++ b/package.json @@ -67,6 +67,7 @@ "immutable": "3.8.2", "intl": "1.2.5", "jest": "^21.0.0", + "jest-junit": "^7.0.0", "js-base64": "2.4.9", "keymirror": "0.1.1", "lodash.bindall": "4.4.0", From 10eef7234f94dd5003ad7bb74f6f0b8be238592f Mon Sep 17 00:00:00 2001 From: rschamp Date: Thu, 15 Aug 2019 22:48:26 -0400 Subject: [PATCH 07/32] Add build artifact --- .circleci/config.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 07401631f..c621864bd 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -54,4 +54,6 @@ jobs: - store_test_results: path: test-results + - store_artifacts: + path: build - run: greenkeeper-lockfile-upload From 2c3f3349b529a9479304eedc37402b4f91ae9b39 Mon Sep 17 00:00:00 2001 From: rschamp Date: Tue, 27 Aug 2019 10:18:00 -0400 Subject: [PATCH 08/32] Add coverage report --- .circleci/config.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c621864bd..edc739df4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -40,20 +40,22 @@ jobs: name: Unit environment: JEST_JUNIT_OUTPUT_DIR: test-results/unit - command: npm run test:unit -- --reporters="default" --reporters="jest-junit" + command: npm run test:unit -- --reporters="default" --reporters="jest-junit" --coverage --coverageReporters=text --coverageReporters=lcov + - store_artifacts: + path: coverage - run: name: Build command: npm run build + - store_artifacts: + path: build - run: name: Integration environment: JEST_JUNIT_OUTPUT_DIR: test-results/integration command: npm run test:integration -- --reporters="default" --reporters="jest-junit" - - store_test_results: path: test-results - - store_artifacts: - path: build + - run: greenkeeper-lockfile-upload From d011aca301c6142f32674fced7f9a541d0bb238f Mon Sep 17 00:00:00 2001 From: rschamp Date: Fri, 30 Aug 2019 14:01:37 -0400 Subject: [PATCH 09/32] Add NPM publish step --- .circleci/config.yml | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index edc739df4..f749a45c3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -2,7 +2,7 @@ # # Check https://circleci.com/docs/2.0/language-javascript/ for more details # -version: 2 +version: 2.1 jobs: build: docker: @@ -49,6 +49,17 @@ jobs: command: npm run build - store_artifacts: path: build + - store_artifacts: + path: dist + - save_cache: + paths: + - build + key: v1-build-{{ .BuildNum }} + - save_cache: + paths: + - dist + key: v1-dist-{{ .BuildNum }} + - run: name: Integration @@ -59,3 +70,29 @@ jobs: path: test-results - run: greenkeeper-lockfile-upload + deploy-npm: + docker: + - image: circleci/node:8.16-browsers + working_directory: ~/repo + steps: + - checkout + - restore_cache: + keys: + - v1-dist-{{ .BuildNum }} + - run: npm publish --dry-run +workflows: + version: 2 + build_and_deploy: + jobs: + - build + - deploy-npm: + requires: + - build + filters: + branches: + only: + - master + - develop + - smoke + - circle + - /^hotfix\/.*/ From f71e117e3a87ca3078fe1575697852f7528f9258 Mon Sep 17 00:00:00 2001 From: rschamp Date: Fri, 30 Aug 2019 14:54:56 -0400 Subject: [PATCH 10/32] Cache git checkouts --- .circleci/config.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index f749a45c3..0969e1f71 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -14,7 +14,15 @@ jobs: working_directory: ~/repo steps: + - restore_cache: + keys: + - v1-git-{{ .Revision }} + - v1-git- - checkout + - save_cache: + paths: + - .git + key: v1-git-{{ .Revision }} # Download and cache dependencies - restore_cache: @@ -75,6 +83,10 @@ jobs: - image: circleci/node:8.16-browsers working_directory: ~/repo steps: + - restore_cache: + keys: + - v1-git-{{ .Revision }} + - v1-git- - checkout - restore_cache: keys: From 07075278004b1d8f6be3bfbced56f3bb257e0bf4 Mon Sep 17 00:00:00 2001 From: rschamp Date: Fri, 30 Aug 2019 14:55:18 -0400 Subject: [PATCH 11/32] Cache builds by commit not build number --- .circleci/config.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 0969e1f71..92d1f3853 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -62,11 +62,11 @@ jobs: - save_cache: paths: - build - key: v1-build-{{ .BuildNum }} + key: v1-build-{{ .Revision }} - save_cache: paths: - dist - key: v1-dist-{{ .BuildNum }} + key: v1-dist-{{ .Revision }} - run: @@ -90,7 +90,7 @@ jobs: - checkout - restore_cache: keys: - - v1-dist-{{ .BuildNum }} + - v1-dist-{{ .Revision }} - run: npm publish --dry-run workflows: version: 2 From 33dc1f70950b78c5a2a36988b2f09fb30261a7c4 Mon Sep 17 00:00:00 2001 From: rschamp Date: Wed, 4 Sep 2019 12:44:04 -0400 Subject: [PATCH 12/32] Remove circle branch from deploy list --- .circleci/config.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 92d1f3853..45faa68a6 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -106,5 +106,4 @@ workflows: - master - develop - smoke - - circle - /^hotfix\/.*/ From 99f2ac586df878b4dce5b4d5aa3874ce03bf4a22 Mon Sep 17 00:00:00 2001 From: rschamp Date: Fri, 6 Sep 2019 10:18:27 -0400 Subject: [PATCH 13/32] Try out yaml inheritance in preparation for parallelization --- .circleci/config.yml | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 45faa68a6..6bd4c2f39 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -92,18 +92,22 @@ jobs: keys: - v1-dist-{{ .Revision }} - run: npm publish --dry-run + +deploy-requirements: &deploy-requirements + requires: + - build + filters: + branches: + only: + - master + - develop + - smoke + - /^hotfix\/.*/ + workflows: version: 2 build_and_deploy: jobs: - build - deploy-npm: - requires: - - build - filters: - branches: - only: - - master - - develop - - smoke - - /^hotfix\/.*/ + <<: *deploy-requirements From fac69fbcf4348384c09d111a82d7b526924978a9 Mon Sep 17 00:00:00 2001 From: rschamp Date: Fri, 6 Sep 2019 10:50:08 -0400 Subject: [PATCH 14/32] Tag after publishing --- .circleci/config.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6bd4c2f39..bdb42469e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -81,8 +81,9 @@ jobs: deploy-npm: docker: - image: circleci/node:8.16-browsers - working_directory: ~/repo + working_directory: ~/repo steps: + - run: echo export RELEASE_VERSION="0.1.0-prerelease.$(date +'%Y%m%d%H%M%S')" >> $BASH_ENV - restore_cache: keys: - v1-git-{{ .Revision }} @@ -91,7 +92,10 @@ jobs: - restore_cache: keys: - v1-dist-{{ .Revision }} + - run: npm version --no-git-tag-version $RELEASE_VERSION - run: npm publish --dry-run + - run: echo git tag $RELEASE_VERSION + - run: echo git push $CIRCLE_REPOSITORY_URL $RELEASE_VERSION deploy-requirements: &deploy-requirements requires: @@ -102,6 +106,7 @@ deploy-requirements: &deploy-requirements - master - develop - smoke + - circle - /^hotfix\/.*/ workflows: From d573e34501c94c8dd2254285be48cf252841b82d Mon Sep 17 00:00:00 2001 From: rschamp Date: Fri, 20 Sep 2019 12:54:45 -0400 Subject: [PATCH 15/32] Add NPM tagging configuration --- .circleci/config.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index bdb42469e..36bd198ce 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -83,7 +83,15 @@ jobs: - image: circleci/node:8.16-browsers working_directory: ~/repo steps: - - run: echo export RELEASE_VERSION="0.1.0-prerelease.$(date +'%Y%m%d%H%M%S')" >> $BASH_ENV + - run: | + echo export RELEASE_VERSION="0.1.0-prerelease.$(date +'%Y%m%d%H%M%S')" >> $BASH_ENV + echo export NPM_TAG=latest >> $BASH_ENV + if [ "$CIRCLE_BRANCH" == "master" ] + then echo export NPM_TAG=circlestable >> $BASH_ENV + fi + if [[ "$CIRCLE_BRANCH" == hotfix/* ]] # double brackets are important for matching the wildcard + then echo export NPM_TAG=circlehotfix >> $BASH_ENV + fi - restore_cache: keys: - v1-git-{{ .Revision }} @@ -93,9 +101,11 @@ jobs: keys: - v1-dist-{{ .Revision }} - run: npm version --no-git-tag-version $RELEASE_VERSION - - run: npm publish --dry-run - run: echo git tag $RELEASE_VERSION - run: echo git push $CIRCLE_REPOSITORY_URL $RELEASE_VERSION + - run: | + npm set //registry.npmjs.org/:_authToken=$NPM_TOKEN + npm publish --dry-run deploy-requirements: &deploy-requirements requires: From 46743c9bf8a1dd75d231aad44b8204bb6574e284 Mon Sep 17 00:00:00 2001 From: rschamp Date: Fri, 20 Sep 2019 12:57:27 -0400 Subject: [PATCH 16/32] Make git tagging do the thing --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 36bd198ce..29ebca82f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -101,11 +101,11 @@ jobs: keys: - v1-dist-{{ .Revision }} - run: npm version --no-git-tag-version $RELEASE_VERSION - - run: echo git tag $RELEASE_VERSION - - run: echo git push $CIRCLE_REPOSITORY_URL $RELEASE_VERSION - run: | npm set //registry.npmjs.org/:_authToken=$NPM_TOKEN npm publish --dry-run + - run: git tag $RELEASE_VERSION + - run: git push $CIRCLE_REPOSITORY_URL $RELEASE_VERSION deploy-requirements: &deploy-requirements requires: From e3cc730cd7cfa9954f146e60b131c7587f198540 Mon Sep 17 00:00:00 2001 From: rschamp Date: Fri, 20 Sep 2019 13:11:40 -0400 Subject: [PATCH 17/32] Make npm publishing do the thing --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 29ebca82f..cd6626367 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -103,7 +103,7 @@ jobs: - run: npm version --no-git-tag-version $RELEASE_VERSION - run: | npm set //registry.npmjs.org/:_authToken=$NPM_TOKEN - npm publish --dry-run + npm publish - run: git tag $RELEASE_VERSION - run: git push $CIRCLE_REPOSITORY_URL $RELEASE_VERSION From c3119aae2c80318d170716370af9291bf2982799 Mon Sep 17 00:00:00 2001 From: rschamp Date: Fri, 20 Sep 2019 13:41:11 -0400 Subject: [PATCH 18/32] Set max-old-space-size for NPM publishing --- .circleci/config.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index cd6626367..6cadb7fa2 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -82,6 +82,8 @@ jobs: docker: - image: circleci/node:8.16-browsers working_directory: ~/repo + environment: + NODE_OPTIONS: --max-old-space-size=4000 steps: - run: | echo export RELEASE_VERSION="0.1.0-prerelease.$(date +'%Y%m%d%H%M%S')" >> $BASH_ENV From 51fbae655e030db560adb0b7e4eb26ad6fb2f272 Mon Sep 17 00:00:00 2001 From: rschamp Date: Fri, 20 Sep 2019 13:59:45 -0400 Subject: [PATCH 19/32] Use circle prefix in default NPM dist channel --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6cadb7fa2..90805b0bd 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -87,7 +87,7 @@ jobs: steps: - run: | echo export RELEASE_VERSION="0.1.0-prerelease.$(date +'%Y%m%d%H%M%S')" >> $BASH_ENV - echo export NPM_TAG=latest >> $BASH_ENV + echo export NPM_TAG=circlelatest >> $BASH_ENV if [ "$CIRCLE_BRANCH" == "master" ] then echo export NPM_TAG=circlestable >> $BASH_ENV fi From 745fa360c3085c51f5869e2500af4502ff6e3541 Mon Sep 17 00:00:00 2001 From: rschamp Date: Fri, 20 Sep 2019 14:31:55 -0400 Subject: [PATCH 20/32] Actually use the tag for npm publish --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 90805b0bd..114f1ceb1 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -105,7 +105,7 @@ jobs: - run: npm version --no-git-tag-version $RELEASE_VERSION - run: | npm set //registry.npmjs.org/:_authToken=$NPM_TOKEN - npm publish + npm publish --tag $NPM_TAG - run: git tag $RELEASE_VERSION - run: git push $CIRCLE_REPOSITORY_URL $RELEASE_VERSION From 4f0bf3c5aafb935b032ff936650c55900f1684e8 Mon Sep 17 00:00:00 2001 From: rschamp Date: Mon, 23 Sep 2019 11:26:24 -0400 Subject: [PATCH 21/32] Add config for gh-pages deploy --- .circleci/config.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 114f1ceb1..41096e15f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -109,6 +109,27 @@ jobs: - run: git tag $RELEASE_VERSION - run: git push $CIRCLE_REPOSITORY_URL $RELEASE_VERSION + deploy-gh-pages: + docker: + - image: circleci/node:8.16-browsers + working_directory: ~/repo + steps: + - restore_cache: + keys: + - v1-git-{{ .Revision }} + - v1-git- + - checkout + - run: | + git config --global user.email $(git log --pretty=format:"%ae" -n1) + git config --global user.name $(git log --pretty=format:"%an" -n1) + - restore_cache: + keys: + - v1-build-{{ .Revision }} + - restore_cache: + keys: + - v1-dependencies-{{ checksum "package-lock.json" }} + - run: npm run deploy -- -e $CIRCLE_BRANCH + deploy-requirements: &deploy-requirements requires: - build @@ -128,3 +149,5 @@ workflows: - build - deploy-npm: <<: *deploy-requirements + - deploy-gh-pages: + <<: *deploy-requirements From 5eb8438782b113d19b7fafc23208ff2a31af875d Mon Sep 17 00:00:00 2001 From: rschamp Date: Mon, 23 Sep 2019 14:40:06 -0400 Subject: [PATCH 22/32] Aliasify The equivalent config for Travis is only 87 lines long, and easy to read. Can CircleCI be similarly easy to read? Is this easy? Are you still reading this? --- .circleci/config.yml | 153 ++++++++++++++++++++----------------------- 1 file changed, 72 insertions(+), 81 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 41096e15f..beb5911ea 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,49 +1,77 @@ -# Javascript Node CircleCI 2.0 configuration file -# -# Check https://circleci.com/docs/2.0/language-javascript/ for more details -# version: 2.1 -jobs: - build: +aliases: + - &step_restore_git_cache + restore_cache: + keys: + - v1-git-{{ .Revision }} + - v1-git- + - &step_save_git_cache + save_cache: + paths: + - .git + key: v1-git-{{ .Revision }} + - &step_restore_dependency_cache + restore_cache: + keys: + - v1-dependencies-{{ checksum "package-lock.json" }} + - v1-dependencies- + - &step_save_dependency_cache + save_cache: + paths: + - node_modules + key: v1-dependencies-{{ checksum "package-lock.json" }} + - &step_save_build_cache + save_cache: + paths: + - build + key: v1-build-{{ .Revision }} + - &step_restore_build_cache + restore_cache: + keys: + - v1-build-{{ .Revision }} + - &step_save_dist_cache + save_cache: + paths: + - dist + key: v1-dist-{{ .Revision }} + - &step_restore_dist_cache + restore_cache: + keys: + - v1-dist-{{ .Revision }} + - &config_job_environment docker: - image: circleci/node:8.16-browsers - + working_directory: ~/repo + - &config_deploy_requirements + requires: + - build + filters: + branches: + only: + - master + - develop + - smoke + - circle + - /^hotfix\/.*/ + +jobs: + build: + <<: *config_job_environment environment: NODE_ENV: production JEST_JUNIT_OUTPUT_NAME: results.xml - working_directory: ~/repo - steps: - - restore_cache: - keys: - - v1-git-{{ .Revision }} - - v1-git- + - *step_restore_git_cache - checkout - - save_cache: - paths: - - .git - key: v1-git-{{ .Revision }} - - # Download and cache dependencies - - restore_cache: - keys: - - v1-dependencies-{{ checksum "package-lock.json" }} - # fallback to using the latest cache if no exact match is found - - v1-dependencies- - + - *step_save_git_cache + - *step_restore_dependency_cache - run: sudo npm install -g greenkeeper-lockfile - run: npm --production=false install - run: greenkeeper-lockfile-update - - - save_cache: - paths: - - node_modules - key: v1-dependencies-{{ checksum "package-lock.json" }} - + - *step_save_dependency_cache - run: name: Lint command: npm run test:lint -- --quiet --output-file test-results/eslint/results.xml --format junit - - run: name: Unit environment: @@ -51,7 +79,6 @@ jobs: command: npm run test:unit -- --reporters="default" --reporters="jest-junit" --coverage --coverageReporters=text --coverageReporters=lcov - store_artifacts: path: coverage - - run: name: Build command: npm run build @@ -59,16 +86,8 @@ jobs: path: build - store_artifacts: path: dist - - save_cache: - paths: - - build - key: v1-build-{{ .Revision }} - - save_cache: - paths: - - dist - key: v1-dist-{{ .Revision }} - - + - *step_save_build_cache + - *step_save_dist_cache - run: name: Integration environment: @@ -76,12 +95,10 @@ jobs: command: npm run test:integration -- --reporters="default" --reporters="jest-junit" - store_test_results: path: test-results - - run: greenkeeper-lockfile-upload + deploy-npm: - docker: - - image: circleci/node:8.16-browsers - working_directory: ~/repo + <<: *config_job_environment environment: NODE_OPTIONS: --max-old-space-size=4000 steps: @@ -94,14 +111,9 @@ jobs: if [[ "$CIRCLE_BRANCH" == hotfix/* ]] # double brackets are important for matching the wildcard then echo export NPM_TAG=circlehotfix >> $BASH_ENV fi - - restore_cache: - keys: - - v1-git-{{ .Revision }} - - v1-git- + - *step_restore_git_cache - checkout - - restore_cache: - keys: - - v1-dist-{{ .Revision }} + - *step_restore_dist_cache - run: npm version --no-git-tag-version $RELEASE_VERSION - run: | npm set //registry.npmjs.org/:_authToken=$NPM_TOKEN @@ -110,37 +122,16 @@ jobs: - run: git push $CIRCLE_REPOSITORY_URL $RELEASE_VERSION deploy-gh-pages: - docker: - - image: circleci/node:8.16-browsers - working_directory: ~/repo + <<: *config_job_environment steps: - - restore_cache: - keys: - - v1-git-{{ .Revision }} - - v1-git- + - *step_restore_git_cache - checkout - run: | git config --global user.email $(git log --pretty=format:"%ae" -n1) git config --global user.name $(git log --pretty=format:"%an" -n1) - - restore_cache: - keys: - - v1-build-{{ .Revision }} - - restore_cache: - keys: - - v1-dependencies-{{ checksum "package-lock.json" }} + - *step_restore_build_cache + - *step_restore_dependency_cache - run: npm run deploy -- -e $CIRCLE_BRANCH - -deploy-requirements: &deploy-requirements - requires: - - build - filters: - branches: - only: - - master - - develop - - smoke - - circle - - /^hotfix\/.*/ workflows: version: 2 @@ -148,6 +139,6 @@ workflows: jobs: - build - deploy-npm: - <<: *deploy-requirements + <<: *config_deploy_requirements - deploy-gh-pages: - <<: *deploy-requirements + <<: *config_deploy_requirements From 5e0fc58f279d0fcdd1cce13ee2d831931594ae3c Mon Sep 17 00:00:00 2001 From: rschamp Date: Mon, 23 Sep 2019 15:29:33 -0400 Subject: [PATCH 23/32] De-alias workflow The requirements for npm publishing and gh-pages are different anyway. --- .circleci/config.yml | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index beb5911ea..24fcca76a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -42,17 +42,6 @@ aliases: docker: - image: circleci/node:8.16-browsers working_directory: ~/repo - - &config_deploy_requirements - requires: - - build - filters: - branches: - only: - - master - - develop - - smoke - - circle - - /^hotfix\/.*/ jobs: build: @@ -139,6 +128,15 @@ workflows: jobs: - build - deploy-npm: - <<: *config_deploy_requirements + requires: + - build + filters: + branches: + only: + - master + - develop + - circle + - /^hotfix\/.*/ - deploy-gh-pages: - <<: *config_deploy_requirements + requires: + - build From 3dbfebe92343d6fb8b128a3c88b5a49113cbed32 Mon Sep 17 00:00:00 2001 From: rschamp Date: Mon, 23 Sep 2019 15:54:46 -0400 Subject: [PATCH 24/32] Parallelize --- .circleci/config.yml | 69 +++++++++++++++++++++++++++++++++++++------- 1 file changed, 58 insertions(+), 11 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 24fcca76a..310c794f7 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -44,23 +44,33 @@ aliases: working_directory: ~/repo jobs: - build: + setup: <<: *config_job_environment - environment: - NODE_ENV: production - JEST_JUNIT_OUTPUT_NAME: results.xml steps: - *step_restore_git_cache - checkout - *step_save_git_cache - - *step_restore_dependency_cache - - run: sudo npm install -g greenkeeper-lockfile - - run: npm --production=false install - - run: greenkeeper-lockfile-update + - run: npm ci - *step_save_dependency_cache + lint: + <<: *config_job_environment + steps: + - *step_restore_git_cache + - checkout + - *step_restore_dependency_cache - run: name: Lint command: npm run test:lint -- --quiet --output-file test-results/eslint/results.xml --format junit + - store_test_results: + path: test-results + unit: + <<: *config_job_environment + environment: + JEST_JUNIT_OUTPUT_NAME: results.xml + steps: + - *step_restore_git_cache + - checkout + - *step_restore_dependency_cache - run: name: Unit environment: @@ -68,6 +78,17 @@ jobs: command: npm run test:unit -- --reporters="default" --reporters="jest-junit" --coverage --coverageReporters=text --coverageReporters=lcov - store_artifacts: path: coverage + - store_test_results: + path: test-results + build: + <<: *config_job_environment + environment: + NODE_ENV: production + NODE_OPTIONS: --max-old-space-size=4000 + steps: + - *step_restore_git_cache + - checkout + - *step_restore_dependency_cache - run: name: Build command: npm run build @@ -77,6 +98,15 @@ jobs: path: dist - *step_save_build_cache - *step_save_dist_cache + integration: + <<: *config_job_environment + environment: + JEST_JUNIT_OUTPUT_NAME: results.txt + steps: + - *step_restore_git_cache + - checkout + - *step_restore_dependency_cache + - *step_restore_build_cache - run: name: Integration environment: @@ -84,7 +114,6 @@ jobs: command: npm run test:integration -- --reporters="default" --reporters="jest-junit" - store_test_results: path: test-results - - run: greenkeeper-lockfile-upload deploy-npm: <<: *config_job_environment @@ -124,11 +153,26 @@ jobs: workflows: version: 2 - build_and_deploy: + build-test-deploy: jobs: - - build + - setup + - lint: + requires: + - setup + - unit: + requires: + - setup + - build: + requires: + - setup + - integration: + requires: + - build - deploy-npm: requires: + - lint + - unit + - integration - build filters: branches: @@ -139,4 +183,7 @@ workflows: - /^hotfix\/.*/ - deploy-gh-pages: requires: + - lint + - unit + - integration - build From 41296a9624f59fdae3ff9a4f634f2b44ded2a6b6 Mon Sep 17 00:00:00 2001 From: rschamp Date: Mon, 23 Sep 2019 16:56:31 -0400 Subject: [PATCH 25/32] Optimize --- .circleci/config.yml | 116 +++++++++++++++++-------------------------- 1 file changed, 45 insertions(+), 71 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 310c794f7..6d396d66f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,76 +1,47 @@ version: 2.1 aliases: - - &step_restore_git_cache - restore_cache: - keys: - - v1-git-{{ .Revision }} - - v1-git- - - &step_save_git_cache - save_cache: - paths: - - .git - key: v1-git-{{ .Revision }} - - &step_restore_dependency_cache - restore_cache: - keys: - - v1-dependencies-{{ checksum "package-lock.json" }} - - v1-dependencies- - - &step_save_dependency_cache - save_cache: - paths: - - node_modules - key: v1-dependencies-{{ checksum "package-lock.json" }} - - &step_save_build_cache - save_cache: - paths: - - build - key: v1-build-{{ .Revision }} - - &step_restore_build_cache - restore_cache: - keys: - - v1-build-{{ .Revision }} - - &step_save_dist_cache - save_cache: - paths: - - dist - key: v1-dist-{{ .Revision }} - - &step_restore_dist_cache - restore_cache: - keys: - - v1-dist-{{ .Revision }} - - &config_job_environment + - &persist + persist_to_workspace: + root: . + paths: . + - &restore + attach_workspace: + at: ~/repo + - &defaults docker: - image: circleci/node:8.16-browsers working_directory: ~/repo jobs: setup: - <<: *config_job_environment + <<: *defaults steps: - - *step_restore_git_cache + - restore_cache: + keys: + - v1-git-{{ .Revision }} + - v1-git- - checkout - - *step_save_git_cache + - save_cache: + paths: + - .git + key: v1-git-{{ .Revision }} - run: npm ci - - *step_save_dependency_cache + - *persist lint: - <<: *config_job_environment + <<: *defaults steps: - - *step_restore_git_cache - - checkout - - *step_restore_dependency_cache + - *restore - run: name: Lint command: npm run test:lint -- --quiet --output-file test-results/eslint/results.xml --format junit - store_test_results: path: test-results unit: - <<: *config_job_environment + <<: *defaults environment: JEST_JUNIT_OUTPUT_NAME: results.xml steps: - - *step_restore_git_cache - - checkout - - *step_restore_dependency_cache + - *restore - run: name: Unit environment: @@ -81,32 +52,34 @@ jobs: - store_test_results: path: test-results build: - <<: *config_job_environment + <<: *defaults environment: NODE_ENV: production NODE_OPTIONS: --max-old-space-size=4000 steps: - - *step_restore_git_cache - - checkout - - *step_restore_dependency_cache + - *restore - run: name: Build command: npm run build + - *persist + store_build: + <<: *defaults + steps: + - *restore - store_artifacts: path: build + store_dist: + <<: *defaults + steps: + - *restore - store_artifacts: path: dist - - *step_save_build_cache - - *step_save_dist_cache integration: - <<: *config_job_environment + <<: *defaults environment: JEST_JUNIT_OUTPUT_NAME: results.txt steps: - - *step_restore_git_cache - - checkout - - *step_restore_dependency_cache - - *step_restore_build_cache + - *restore - run: name: Integration environment: @@ -116,10 +89,11 @@ jobs: path: test-results deploy-npm: - <<: *config_job_environment + <<: *defaults environment: NODE_OPTIONS: --max-old-space-size=4000 steps: + - *restore - run: | echo export RELEASE_VERSION="0.1.0-prerelease.$(date +'%Y%m%d%H%M%S')" >> $BASH_ENV echo export NPM_TAG=circlelatest >> $BASH_ENV @@ -129,9 +103,6 @@ jobs: if [[ "$CIRCLE_BRANCH" == hotfix/* ]] # double brackets are important for matching the wildcard then echo export NPM_TAG=circlehotfix >> $BASH_ENV fi - - *step_restore_git_cache - - checkout - - *step_restore_dist_cache - run: npm version --no-git-tag-version $RELEASE_VERSION - run: | npm set //registry.npmjs.org/:_authToken=$NPM_TOKEN @@ -140,15 +111,12 @@ jobs: - run: git push $CIRCLE_REPOSITORY_URL $RELEASE_VERSION deploy-gh-pages: - <<: *config_job_environment + <<: *defaults steps: - - *step_restore_git_cache - - checkout + - *restore - run: | git config --global user.email $(git log --pretty=format:"%ae" -n1) git config --global user.name $(git log --pretty=format:"%an" -n1) - - *step_restore_build_cache - - *step_restore_dependency_cache - run: npm run deploy -- -e $CIRCLE_BRANCH workflows: @@ -168,6 +136,12 @@ workflows: - integration: requires: - build + - store_build: + requires: + - build + - store_dist: + requires: + - build - deploy-npm: requires: - lint From 2df4df0791714e8070d0fc60fb6c81b0d0bbc297 Mon Sep 17 00:00:00 2001 From: rschamp Date: Mon, 23 Sep 2019 20:57:27 -0400 Subject: [PATCH 26/32] Use granular caching --- .circleci/config.yml | 87 +++++++++++++++++++++++++++++++------------- 1 file changed, 62 insertions(+), 25 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6d396d66f..79b8afced 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,12 +1,42 @@ version: 2.1 aliases: - - &persist - persist_to_workspace: - root: . - paths: . - - &restore - attach_workspace: - at: ~/repo + - &save_git_cache + save_cache: + paths: + - .git + key: v1-git-{{ .Revision }} + - &restore_git_cache + restore_cache: + keys: + - v1-git-{{ .Revision }} + - v1-git- + - &save_build_cache + save_cache: + paths: + - build + key: v1-build-{{ .Revision }} + - &restore_build_cache + restore_cache: + keys: + - v1-build-{{ .Revision }} + - &save_dist_cache + save_cache: + paths: + - dist + key: v1-dist-{{ .Revision }} + - &restore_dist_cache + restore_cache: + keys: + - v1-dist-{{ .Revision }} + - &save_npm_cache + save_cache: + paths: + - node_modules + key: v1-npm-{{ checksum "package-lock.json" }} + - &restore_npm_cache + restore_cache: + keys: + - v1-npm-{{ checksum "package-lock.json" }} - &defaults docker: - image: circleci/node:8.16-browsers @@ -16,21 +46,17 @@ jobs: setup: <<: *defaults steps: - - restore_cache: - keys: - - v1-git-{{ .Revision }} - - v1-git- + - *restore_git_cache - checkout - - save_cache: - paths: - - .git - key: v1-git-{{ .Revision }} + - *save_git_cache - run: npm ci - - *persist + - *save_npm_cache lint: <<: *defaults steps: - - *restore + - *restore_git_cache + - *restore_npm_cache + - checkout - run: name: Lint command: npm run test:lint -- --quiet --output-file test-results/eslint/results.xml --format junit @@ -41,7 +67,9 @@ jobs: environment: JEST_JUNIT_OUTPUT_NAME: results.xml steps: - - *restore + - *restore_git_cache + - *restore_npm_cache + - checkout - run: name: Unit environment: @@ -57,21 +85,24 @@ jobs: NODE_ENV: production NODE_OPTIONS: --max-old-space-size=4000 steps: - - *restore + - *restore_git_cache + - *restore_npm_cache + - checkout - run: name: Build command: npm run build - - *persist + - *save_build_cache + - *save_dist_cache store_build: <<: *defaults steps: - - *restore + - *restore_build_cache - store_artifacts: path: build store_dist: <<: *defaults steps: - - *restore + - *restore_dist_cache - store_artifacts: path: dist integration: @@ -79,7 +110,9 @@ jobs: environment: JEST_JUNIT_OUTPUT_NAME: results.txt steps: - - *restore + - *restore_git_cache + - *restore_npm_cache + - checkout - run: name: Integration environment: @@ -93,7 +126,9 @@ jobs: environment: NODE_OPTIONS: --max-old-space-size=4000 steps: - - *restore + - *restore_git_cache + - *restore_dist_cache + - checkout - run: | echo export RELEASE_VERSION="0.1.0-prerelease.$(date +'%Y%m%d%H%M%S')" >> $BASH_ENV echo export NPM_TAG=circlelatest >> $BASH_ENV @@ -113,7 +148,9 @@ jobs: deploy-gh-pages: <<: *defaults steps: - - *restore + - *restore_git_cache + - *restore_npm_cache + - checkout - run: | git config --global user.email $(git log --pretty=format:"%ae" -n1) git config --global user.name $(git log --pretty=format:"%an" -n1) From 0f589004a1a7d6ed16630892d32d3a2359e9a9c2 Mon Sep 17 00:00:00 2001 From: rschamp Date: Mon, 23 Sep 2019 21:31:42 -0400 Subject: [PATCH 27/32] Use npm install to get better cache benefits --- .circleci/config.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 79b8afced..d02872202 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -37,6 +37,7 @@ aliases: restore_cache: keys: - v1-npm-{{ checksum "package-lock.json" }} + - v1-npm- - &defaults docker: - image: circleci/node:8.16-browsers @@ -47,9 +48,10 @@ jobs: <<: *defaults steps: - *restore_git_cache + - *restore_npm_cache - checkout + - run: npm install - *save_git_cache - - run: npm ci - *save_npm_cache lint: <<: *defaults From 7ccf9f5bef60269dfcdd111fd9c1075e66113e0d Mon Sep 17 00:00:00 2001 From: rschamp Date: Mon, 23 Sep 2019 21:35:26 -0400 Subject: [PATCH 28/32] FIx cache ordering --- .circleci/config.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index d02872202..00a1f0fe0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -57,8 +57,8 @@ jobs: <<: *defaults steps: - *restore_git_cache - - *restore_npm_cache - checkout + - *restore_npm_cache - run: name: Lint command: npm run test:lint -- --quiet --output-file test-results/eslint/results.xml --format junit @@ -70,8 +70,8 @@ jobs: JEST_JUNIT_OUTPUT_NAME: results.xml steps: - *restore_git_cache - - *restore_npm_cache - checkout + - *restore_npm_cache - run: name: Unit environment: @@ -88,8 +88,8 @@ jobs: NODE_OPTIONS: --max-old-space-size=4000 steps: - *restore_git_cache - - *restore_npm_cache - checkout + - *restore_npm_cache - run: name: Build command: npm run build @@ -113,8 +113,8 @@ jobs: JEST_JUNIT_OUTPUT_NAME: results.txt steps: - *restore_git_cache - - *restore_npm_cache - checkout + - *restore_npm_cache - run: name: Integration environment: @@ -151,8 +151,8 @@ jobs: <<: *defaults steps: - *restore_git_cache - - *restore_npm_cache - checkout + - *restore_npm_cache - run: | git config --global user.email $(git log --pretty=format:"%ae" -n1) git config --global user.name $(git log --pretty=format:"%an" -n1) From 859e636d1a3d82be72244d91c584ecfbeacf2d84 Mon Sep 17 00:00:00 2001 From: rschamp Date: Mon, 23 Sep 2019 21:48:47 -0400 Subject: [PATCH 29/32] Moar parallel --- .circleci/config.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 00a1f0fe0..7e004c39d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -109,17 +109,21 @@ jobs: path: dist integration: <<: *defaults + parallelism: 2 environment: JEST_JUNIT_OUTPUT_NAME: results.txt steps: - *restore_git_cache - checkout - *restore_npm_cache + - *restore_build_cache - run: name: Integration environment: JEST_JUNIT_OUTPUT_DIR: test-results/integration - command: npm run test:integration -- --reporters="default" --reporters="jest-junit" + command: | + export TESTFILES=$(circleci tests glob "test/integration/*.test.js" | circleci tests split --split-by=timings) + $(npm bin)/jest ${TESTFILES} --reporters="default" --reporters="jest-junit" - store_test_results: path: test-results From 931a17462a5c0a8fda69881a5b3de4605f03b519 Mon Sep 17 00:00:00 2001 From: rschamp Date: Mon, 23 Sep 2019 22:19:22 -0400 Subject: [PATCH 30/32] Add build to build deploy step --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7e004c39d..a6e73dc22 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -157,6 +157,7 @@ jobs: - *restore_git_cache - checkout - *restore_npm_cache + - *restore_build_cache - run: | git config --global user.email $(git log --pretty=format:"%ae" -n1) git config --global user.name $(git log --pretty=format:"%an" -n1) From 7070b19562487a40dbe7cc32a4de4c4dbea188b8 Mon Sep 17 00:00:00 2001 From: rschamp Date: Tue, 24 Sep 2019 09:44:19 -0400 Subject: [PATCH 31/32] Fix npm cache order in setup --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a6e73dc22..e82649a18 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -48,8 +48,8 @@ jobs: <<: *defaults steps: - *restore_git_cache - - *restore_npm_cache - checkout + - *restore_npm_cache - run: npm install - *save_git_cache - *save_npm_cache From a3400b3b0feb7f0d1460fbd3ebb38d49599c5fb1 Mon Sep 17 00:00:00 2001 From: rschamp Date: Mon, 30 Sep 2019 14:22:58 -0400 Subject: [PATCH 32/32] Disable publishing While CircleCI is running in parallel with Travis, let Travis continue to handle the deployments. --- .circleci/config.yml | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index e82649a18..764f5e1c8 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -186,22 +186,22 @@ workflows: - store_dist: requires: - build - - deploy-npm: - requires: - - lint - - unit - - integration - - build - filters: - branches: - only: - - master - - develop - - circle - - /^hotfix\/.*/ - - deploy-gh-pages: - requires: - - lint - - unit - - integration - - build + # Disable deployment while running in parallel with Travis + # - deploy-npm: + # requires: + # - lint + # - unit + # - integration + # - build + # filters: + # branches: + # only: + # - master + # - develop + # - /^hotfix\/.*/ + # - deploy-gh-pages: + # requires: + # - lint + # - unit + # - integration + # - build