From 6b7d4c58401b705bef7d24ca56dc2b0a7af3e485 Mon Sep 17 00:00:00 2001 From: Nick Schot Date: Wed, 23 Jan 2019 13:58:58 +0100 Subject: [PATCH 01/17] Update to CircleCI v2 --- circle.yml | 153 +++++++++++++++++++++++++++-------------------------- 1 file changed, 77 insertions(+), 76 deletions(-) diff --git a/circle.yml b/circle.yml index 0e7521b0..07d17534 100644 --- a/circle.yml +++ b/circle.yml @@ -1,77 +1,78 @@ -machine: - node: - version: 6 - environment: - NODE_ENV: test - DROP_DATABASE: DROP DATABASE IF EXISTS lux_test; - CREATE_DATABASE: CREATE DATABASE lux_test; - DATABASE_USERNAME: ubuntu -database: - override: - - psql -c "$DROP_DATABASE" -U postgres - - psql -c "$CREATE_DATABASE" -U postgres - - mysql -e "$DROP_DATABASE" - - mysql -e "$CREATE_DATABASE" -dependencies: - pre: - - | - cd ../ - - if [ -d watchman ]; then - cd watchman - sudo make install - else - git clone https://github.com/facebook/watchman.git - cd watchman - git checkout v4.7.0 - - ./autogen.sh - ./configure - make - sudo make install - fi - - cd ../lux - override: - - npm install - - npm link - post: - - | - cd test/test-app - npm install - cd ../../ - cache_directories: - - /home/ubuntu/watchman -compile: - pre: - - npm run clean - override: - - npm run build -test: - pre: - - case $CIRCLE_NODE_INDEX in 0) export DATABASE_DRIVER="pg" ;; 1) export DATABASE_DRIVER="mysql2" ;; 2) export DATABASE_DRIVER="sqlite3" ;; esac: - parallel: true - override: - - npm run flow: - parallel: true - - npm run lint: - parallel: true - - npm test -- -R mocha-junit-reporter: - parallel: true +version: 2 +jobs: + build: + docker: + - image: zacharygolba/lux-framework:latest environment: - MOCHA_FILE: $CIRCLE_TEST_REPORTS/junit/test-results.xml - post: - - npm run codecov: - parallel: true -notify: - webhooks: - - url: https://webhooks.gitter.im/e/6d49c9b19c888dba70b8 -deployment: - release: - tag: /^(?:v\d.\d.\d)$/ - commands: - - npm run clean - - npm run build - - rm -rf ~/.npmrc && touch ~/.npmrc - - echo //registry.npmjs.org/:_authToken=$NPM_AUTH_TOKEN >> ~/.npmrc - - npm publish + NODE_ENV: test + DATABASE_USERNAME: root + - image: mysql:5.7 + environment: + MYSQL_DATABASE: lux_test + MYSQL_ALLOW_EMPTY_PASSWORD: yes + - image: postgres:9.6 + environment: + POSTGRES_USER: root + POSTGRES_DB: lux_test + parallelism: 3 + working_directory: ~/lux + steps: + - checkout + - restore_cache: + keys: + - dependency-cache- + - run: + name: Install Dependencies + command: | + yarn global remove lux-framework + yarn install + cd test/test-app + yarn install + cd ../../ + - save_cache: + key: dependency-cache-{{ epoch }} + paths: + - ~/.yarn + - ~/.yarn-cache + - restore_cache: + key: eslint-cache- + - run: + name: Lint + command: yarn lint + - save_cache: + key: eslint-cache-{{ epoch }} + paths: + - ~/lux/.eslintcache + - run: + name: Check Types + command: yarn flow + - run: + name: Compile + command: | + yarn run clean + NODE_ENV=production yarn build + yarn link + cd test/test-app + lux build -e test + cd ../../ + - run: + name: Seed Database + command: | + if [ "${CIRCLE_NODE_INDEX}" != "2" ]; then + cd test/test-app + lux db:migrate -e test --skip-build + lux db:seed -e test --skip-build + cd ../../ + fi + - restore_cache: + key: jest-cache- + - run: + name: Test + command: yarn test -- -w=8 --colors --coverage + - save_cache: + key: jest-cache-{{ epoch }} + paths: + - ~/lux/.jest-cache + - run: + name: Report Coverage + command: yarn codecov From 28a19b28f9f52247773c5ae683315f6412a324ad Mon Sep 17 00:00:00 2001 From: Nick Schot Date: Wed, 23 Jan 2019 14:23:46 +0100 Subject: [PATCH 02/17] update yarn --- circle.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/circle.yml b/circle.yml index 07d17534..e1f6221e 100644 --- a/circle.yml +++ b/circle.yml @@ -24,6 +24,7 @@ jobs: - run: name: Install Dependencies command: | + npm i -g yarn yarn global remove lux-framework yarn install cd test/test-app From 35aed23d50061a968edaf5c11bfee01013d398aa Mon Sep 17 00:00:00 2001 From: Nick Schot Date: Wed, 23 Jan 2019 14:32:32 +0100 Subject: [PATCH 03/17] undo yarn update --- circle.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/circle.yml b/circle.yml index e1f6221e..07d17534 100644 --- a/circle.yml +++ b/circle.yml @@ -24,7 +24,6 @@ jobs: - run: name: Install Dependencies command: | - npm i -g yarn yarn global remove lux-framework yarn install cd test/test-app From 7af56fb1dd9ef686b02468af4c832108f3cfcf0f Mon Sep 17 00:00:00 2001 From: Nick Schot Date: Thu, 24 Jan 2019 10:28:40 +0100 Subject: [PATCH 04/17] fix paths --- .flowconfig | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/.flowconfig b/.flowconfig index 27dc7752..d0b43b5c 100644 --- a/.flowconfig +++ b/.flowconfig @@ -10,10 +10,10 @@ ./node_modules/ [libs] -node_modules/rollup-plugin-lux/decl/ -node_modules/rollup-plugin-lux/flow-typed/ -flow-typed/ -decl/ +./node_modules/rollup-plugin-lux/decl/ +./node_modules/rollup-plugin-lux/flow-typed/ +./flow-typed/ +./decl/ [options] emoji=true @@ -27,6 +27,3 @@ unsafe.enable_getters_and_setters=true esproposal.class_static_fields=enable esproposal.class_instance_fields=enable - -[version] -^0.38.0 From 4eda6775face4ac1ccd126d83ccf1573aaddc515 Mon Sep 17 00:00:00 2001 From: Nick Schot Date: Thu, 24 Jan 2019 10:32:28 +0100 Subject: [PATCH 05/17] set USER env variable for flow --- circle.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/circle.yml b/circle.yml index 07d17534..444d121f 100644 --- a/circle.yml +++ b/circle.yml @@ -45,7 +45,7 @@ jobs: - ~/lux/.eslintcache - run: name: Check Types - command: yarn flow + command: USER=flowuser yarn flow - run: name: Compile command: | From 89c0339048889f63880643fcc326ed3e4cdcbda9 Mon Sep 17 00:00:00 2001 From: Nick Schot Date: Thu, 24 Jan 2019 10:38:02 +0100 Subject: [PATCH 06/17] try different docker image --- circle.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/circle.yml b/circle.yml index 444d121f..2420d8c9 100644 --- a/circle.yml +++ b/circle.yml @@ -2,7 +2,7 @@ version: 2 jobs: build: docker: - - image: zacharygolba/lux-framework:latest + - image: circleci/node:11 environment: NODE_ENV: test DATABASE_USERNAME: root @@ -45,7 +45,7 @@ jobs: - ~/lux/.eslintcache - run: name: Check Types - command: USER=flowuser yarn flow + command: yarn flow - run: name: Compile command: | From 87f3b36dd612f95050796b931ec5dc3abc035520 Mon Sep 17 00:00:00 2001 From: Nick Schot Date: Thu, 24 Jan 2019 10:40:40 +0100 Subject: [PATCH 07/17] update config --- circle.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/circle.yml b/circle.yml index 2420d8c9..28c63829 100644 --- a/circle.yml +++ b/circle.yml @@ -24,7 +24,6 @@ jobs: - run: name: Install Dependencies command: | - yarn global remove lux-framework yarn install cd test/test-app yarn install From c7c6ccd673497a585de944a29559db1fca1da5a2 Mon Sep 17 00:00:00 2001 From: Nick Schot Date: Thu, 24 Jan 2019 10:43:25 +0100 Subject: [PATCH 08/17] update sqlite --- test/test-app/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test-app/package.json b/test/test-app/package.json index dec00db8..25b4dc25 100644 --- a/test/test-app/package.json +++ b/test/test-app/package.json @@ -19,6 +19,6 @@ "mysql2": "1.2.0", "pg": "6.2.2", "source-map-support": "0.4.15", - "sqlite3": "3.1.8" + "sqlite3": "4.0.6" } } From edc0b2e09ca98796ed4dc1f494a8dcf2767aff8c Mon Sep 17 00:00:00 2001 From: Nick Schot Date: Thu, 24 Jan 2019 10:45:38 +0100 Subject: [PATCH 09/17] update flow --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 70b996a7..c8b4515f 100644 --- a/package.json +++ b/package.json @@ -65,8 +65,8 @@ "eslint-plugin-flowtype": "2.33.0", "eslint-plugin-import": "2.2.0", "faker": "4.1.0", - "flow-bin": "0.38.0", - "flow-typed": "2.1.2", + "flow-bin": "0.91.0", + "flow-typed": "2.5.1", "mocha": "3.4.1", "mocha-junit-reporter": "1.13.0", "node-fetch": "1.6.3", From eeae922f13586bd990acfa6d4cc1f2131605954d Mon Sep 17 00:00:00 2001 From: Nick Schot Date: Thu, 24 Jan 2019 10:46:53 +0100 Subject: [PATCH 10/17] update config --- .flowconfig | 3 --- package.json | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/.flowconfig b/.flowconfig index d0b43b5c..f572540f 100644 --- a/.flowconfig +++ b/.flowconfig @@ -17,13 +17,10 @@ [options] emoji=true -strip_root=true suppress_comment=\\(.\\|\n\\)*\\$FlowIgnore module.name_mapper='LUX_LOCAL' -> '' module.name_mapper='rollup-plugin-lux' -> '/node_modules/rollup-plugin-lux/src/index.js' -unsafe.enable_getters_and_setters=true - esproposal.class_static_fields=enable esproposal.class_instance_fields=enable diff --git a/package.json b/package.json index c8b4515f..d2dabfe8 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "build": "rollup -c", "clean": "shx rm -rf .nyc_output coverage dist test/test-app/dist test-results.xml", "codecov": "nyc report --reporter=lcov > coverage.lcov && curl -s https://codecov.io/bash | bash", - "flow": "flow check", + "flow": "flow check --strip-root", "types": "shx rm -rf flow-typed && flow-typed install", "lint": "remark . && eslint .", "test": "nyc -i ./lib/babel-hook.js --instrument false --source-map false mocha --opts mocha.opts", From 9242136d6b9294a9b8933cc061021e668e28cf73 Mon Sep 17 00:00:00 2001 From: Nick Schot Date: Thu, 24 Jan 2019 11:33:41 +0100 Subject: [PATCH 11/17] update config --- .flowconfig | 3 +++ circle.yml | 5 +++++ package.json | 6 +++--- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.flowconfig b/.flowconfig index f572540f..d0b43b5c 100644 --- a/.flowconfig +++ b/.flowconfig @@ -17,10 +17,13 @@ [options] emoji=true +strip_root=true suppress_comment=\\(.\\|\n\\)*\\$FlowIgnore module.name_mapper='LUX_LOCAL' -> '' module.name_mapper='rollup-plugin-lux' -> '/node_modules/rollup-plugin-lux/src/index.js' +unsafe.enable_getters_and_setters=true + esproposal.class_static_fields=enable esproposal.class_instance_fields=enable diff --git a/circle.yml b/circle.yml index 28c63829..9ea5241b 100644 --- a/circle.yml +++ b/circle.yml @@ -17,6 +17,11 @@ jobs: parallelism: 3 working_directory: ~/lux steps: + - run: + name: Install prerequisits + command: | + apt-get update -qq + apt-get install -qy libelf1 - checkout - restore_cache: keys: diff --git a/package.json b/package.json index d2dabfe8..70b996a7 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "build": "rollup -c", "clean": "shx rm -rf .nyc_output coverage dist test/test-app/dist test-results.xml", "codecov": "nyc report --reporter=lcov > coverage.lcov && curl -s https://codecov.io/bash | bash", - "flow": "flow check --strip-root", + "flow": "flow check", "types": "shx rm -rf flow-typed && flow-typed install", "lint": "remark . && eslint .", "test": "nyc -i ./lib/babel-hook.js --instrument false --source-map false mocha --opts mocha.opts", @@ -65,8 +65,8 @@ "eslint-plugin-flowtype": "2.33.0", "eslint-plugin-import": "2.2.0", "faker": "4.1.0", - "flow-bin": "0.91.0", - "flow-typed": "2.5.1", + "flow-bin": "0.38.0", + "flow-typed": "2.1.2", "mocha": "3.4.1", "mocha-junit-reporter": "1.13.0", "node-fetch": "1.6.3", From ab955d8cf3e4fefb54198db9e3fc2d88c04a5d2d Mon Sep 17 00:00:00 2001 From: Nick Schot Date: Thu, 24 Jan 2019 11:35:09 +0100 Subject: [PATCH 12/17] fix: don't update belongsTo relationships for new records NOTE: side-effect is that duplicate ID's might occur when DB does not have a UNIQUE constraint on the FK --- circle.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/circle.yml b/circle.yml index 9ea5241b..a45b354c 100644 --- a/circle.yml +++ b/circle.yml @@ -20,8 +20,8 @@ jobs: - run: name: Install prerequisits command: | - apt-get update -qq - apt-get install -qy libelf1 + sudo apt-get update -qq + sudo apt-get install -qy libelf1 - checkout - restore_cache: keys: From 2af6af91a339397a3fae7add23bf303b394075cd Mon Sep 17 00:00:00 2001 From: Nick Schot Date: Thu, 24 Jan 2019 11:57:20 +0100 Subject: [PATCH 13/17] move circle --- .circleci/config.yml | 79 ++++++++++++++++++++++++++++++++++++++++++ circle.yml | 82 -------------------------------------------- 2 files changed, 79 insertions(+), 82 deletions(-) create mode 100644 .circleci/config.yml delete mode 100644 circle.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 00000000..e143f021 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,79 @@ +--- +version: 2 +jobs: + build: + docker: + - image: circleci/node:6 + environment: + NODE_ENV: test + DROP_DATABASE: DROP DATABASE IF EXISTS lux_test; + CREATE_DATABASE: CREATE DATABASE lux_test; + DATABASE_USERNAME: ubuntu + steps: + - checkout + - run: + command: | + cd ../ + + if [ -d watchman ]; then + cd watchman + sudo make install + else + git clone https://github.com/facebook/watchman.git + cd watchman + git checkout v4.7.0 + + ./autogen.sh + ./configure + make + sudo make install + fi + + cd ../lux + - run: + command: npm install + - run: + command: npm link + - run: + command: | + cd test/test-app + npm install + cd ../../ + - run: + command: psql -c "$DROP_DATABASE" -U postgres + - run: + command: psql -c "$CREATE_DATABASE" -U postgres + - run: + command: mysql -e "$DROP_DATABASE" + - run: + command: mysql -e "$CREATE_DATABASE" + - run: + command: npm run clean + - run: + command: npm run build + - run: + parallel: true + command: case $CIRCLE_NODE_INDEX in 0) export DATABASE_DRIVER="pg" ;; 1) export + DATABASE_DRIVER="mysql2" ;; 2) export DATABASE_DRIVER="sqlite3" ;; esac + - run: + parallel: true + command: npm run flow + - run: + parallel: true + command: npm run lint + - run: + parallel: true + environment: + MOCHA_FILE: "$CIRCLE_TEST_REPORTS/junit/test-results.xml" + command: npm test -- -R mocha-junit-reporter + - run: + parallel: true + command: npm run codecov + - deploy: + name: release + command: |- + if false; then + true + else + echo "Not target branch so not deploying" + fi diff --git a/circle.yml b/circle.yml deleted file mode 100644 index a45b354c..00000000 --- a/circle.yml +++ /dev/null @@ -1,82 +0,0 @@ -version: 2 -jobs: - build: - docker: - - image: circleci/node:11 - environment: - NODE_ENV: test - DATABASE_USERNAME: root - - image: mysql:5.7 - environment: - MYSQL_DATABASE: lux_test - MYSQL_ALLOW_EMPTY_PASSWORD: yes - - image: postgres:9.6 - environment: - POSTGRES_USER: root - POSTGRES_DB: lux_test - parallelism: 3 - working_directory: ~/lux - steps: - - run: - name: Install prerequisits - command: | - sudo apt-get update -qq - sudo apt-get install -qy libelf1 - - checkout - - restore_cache: - keys: - - dependency-cache- - - run: - name: Install Dependencies - command: | - yarn install - cd test/test-app - yarn install - cd ../../ - - save_cache: - key: dependency-cache-{{ epoch }} - paths: - - ~/.yarn - - ~/.yarn-cache - - restore_cache: - key: eslint-cache- - - run: - name: Lint - command: yarn lint - - save_cache: - key: eslint-cache-{{ epoch }} - paths: - - ~/lux/.eslintcache - - run: - name: Check Types - command: yarn flow - - run: - name: Compile - command: | - yarn run clean - NODE_ENV=production yarn build - yarn link - cd test/test-app - lux build -e test - cd ../../ - - run: - name: Seed Database - command: | - if [ "${CIRCLE_NODE_INDEX}" != "2" ]; then - cd test/test-app - lux db:migrate -e test --skip-build - lux db:seed -e test --skip-build - cd ../../ - fi - - restore_cache: - key: jest-cache- - - run: - name: Test - command: yarn test -- -w=8 --colors --coverage - - save_cache: - key: jest-cache-{{ epoch }} - paths: - - ~/lux/.jest-cache - - run: - name: Report Coverage - command: yarn codecov From 0df4557a12c8613c69c9d211c06fdedd905e0dae Mon Sep 17 00:00:00 2001 From: Nick Schot Date: Thu, 24 Jan 2019 12:12:37 +0100 Subject: [PATCH 14/17] update config --- .circleci/config.yml | 170 +++++++++++++++++++++++++++++-------------- 1 file changed, 116 insertions(+), 54 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index e143f021..67655143 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,18 +1,74 @@ ---- +# This configuration was automatically generated from a CircleCI 1.0 config. +# It should include any build commands you had along with commands that CircleCI +# inferred from your project structure. We strongly recommend you read all the +# comments in this file to understand the structure of CircleCI 2.0, as the idiom +# for configuration has changed substantially in 2.0 to allow arbitrary jobs rather +# than the prescribed lifecycle of 1.0. In general, we recommend using this generated +# configuration as a reference rather than using it in production, though in most +# cases it should duplicate the execution of your original 1.0 config. version: 2 jobs: build: + working_directory: ~/lux + parallelism: 1 + shell: /bin/bash --login + # CircleCI 2.0 does not support environment variables that refer to each other the same way as 1.0 did. + # If any of these refer to each other, rewrite them so that they don't or see https://circleci.com/docs/2.0/env-vars/#interpolating-environment-variables-to-set-other-environment-variables . + environment: + CIRCLE_ARTIFACTS: /tmp/circleci-artifacts + CIRCLE_TEST_REPORTS: /tmp/circleci-test-results + NODE_ENV: test + DROP_DATABASE: DROP DATABASE IF EXISTS lux_test; + CREATE_DATABASE: CREATE DATABASE lux_test; + DATABASE_USERNAME: ubuntu + # In CircleCI 1.0 we used a pre-configured image with a large number of languages and other packages. + # In CircleCI 2.0 you can now specify your own image, or use one of our pre-configured images. + # The following configuration line tells CircleCI to use the specified docker image as the runtime environment for you job. + # We have selected a pre-built image that mirrors the build environment we use on + # the 1.0 platform, but we recommend you choose an image more tailored to the needs + # of each job. For more information on choosing an image (or alternatively using a + # VM instead of a container) see https://circleci.com/docs/2.0/executor-types/ + # To see the list of pre-built images that CircleCI provides for most common languages see + # https://circleci.com/docs/2.0/circleci-images/ docker: - - image: circleci/node:6 - environment: - NODE_ENV: test - DROP_DATABASE: DROP DATABASE IF EXISTS lux_test; - CREATE_DATABASE: CREATE DATABASE lux_test; - DATABASE_USERNAME: ubuntu + - image: zacharygolba/lux-framework:latest + environment: + NODE_ENV: test + DATABASE_USERNAME: root + - image: mysql:5.7 + environment: + MYSQL_DATABASE: lux_test + MYSQL_ALLOW_EMPTY_PASSWORD: yes + - image: postgres:9.6 + environment: + POSTGRES_USER: root + POSTGRES_DB: lux_test steps: - - checkout - - run: - command: | + # Machine Setup + # If you break your build into multiple jobs with workflows, you will probably want to do the parts of this that are relevant in each + # The following `checkout` command checks out your code to your working directory. In 1.0 we did this implicitly. In 2.0 you can choose where in the course of a job your code should be checked out. + - checkout + # Prepare for artifact and test results collection equivalent to how it was done on 1.0. + # In many cases you can simplify this from what is generated here. + # 'See docs on artifact collection here https://circleci.com/docs/2.0/artifacts/' + - run: mkdir -p $CIRCLE_ARTIFACTS $CIRCLE_TEST_REPORTS + # This is based on your 1.0 configuration file or project settings + - run: + working_directory: ~/lux + command: nvm install 6 && nvm alias default 6 + # Dependencies + # This would typically go in either a build or a build-and-test job when using workflows + # Restore the dependency cache + - restore_cache: + keys: + # This branch if available + - v1-dep-{{ .Branch }}- + # Default branch if not + - v1-dep-stable- + # Any branch if there are none on the default branch - this should be unnecessary if you have your default branch configured correctly + - v1-dep- + # This is based on your 1.0 configuration file or project settings + - run: | cd ../ if [ -d watchman ]; then @@ -30,50 +86,56 @@ jobs: fi cd ../lux - - run: - command: npm install - - run: - command: npm link - - run: - command: | + # This is based on your 1.0 configuration file or project settings + - run: npm install + - run: npm link + # This is based on your 1.0 configuration file or project settings + - run: | cd test/test-app npm install cd ../../ - - run: - command: psql -c "$DROP_DATABASE" -U postgres - - run: - command: psql -c "$CREATE_DATABASE" -U postgres - - run: - command: mysql -e "$DROP_DATABASE" - - run: - command: mysql -e "$CREATE_DATABASE" - - run: - command: npm run clean - - run: - command: npm run build - - run: - parallel: true - command: case $CIRCLE_NODE_INDEX in 0) export DATABASE_DRIVER="pg" ;; 1) export - DATABASE_DRIVER="mysql2" ;; 2) export DATABASE_DRIVER="sqlite3" ;; esac - - run: - parallel: true - command: npm run flow - - run: - parallel: true - command: npm run lint - - run: - parallel: true - environment: - MOCHA_FILE: "$CIRCLE_TEST_REPORTS/junit/test-results.xml" - command: npm test -- -R mocha-junit-reporter - - run: - parallel: true - command: npm run codecov - - deploy: - name: release - command: |- - if false; then - true - else - echo "Not target branch so not deploying" - fi + # Save dependency cache + - save_cache: + key: v1-dep-{{ .Branch }}-{{ epoch }} + paths: + - /home/ubuntu/watchman + - ./node_modules + # This is based on your 1.0 configuration file or project settings + - run: psql -c "$DROP_DATABASE" -U postgres + - run: psql -c "$CREATE_DATABASE" -U postgres + - run: mysql -e "$DROP_DATABASE" + - run: mysql -e "$CREATE_DATABASE" + # Compile + # This would typically go in either a build or a build-and-test job when using workflows + # This is based on your 1.0 configuration file or project settings + - run: npm run clean + # This is based on your 1.0 configuration file or project settings + - run: npm run build + # Test + # This would typically be a build job when using workflows, possibly combined with build + # This is based on your 1.0 configuration file or project settings + - run: case $CIRCLE_NODE_INDEX in 0) export DATABASE_DRIVER="pg" ;; 1) export DATABASE_DRIVER="mysql2" ;; 2) export DATABASE_DRIVER="sqlite3" ;; esac + # This is based on your 1.0 configuration file or project settings + - run: npm run flow + - run: npm run lint + - run: + command: npm test -- -R mocha-junit-reporter + environment: + MOCHA_FILE: $CIRCLE_TEST_REPORTS/junit/test-results.xml + # This is based on your 1.0 configuration file or project settings + - run: npm run codecov + # Deployment + # Your existing circle.yml file contains deployment steps. + # The config translation tool does not support translating deployment steps + # since deployment in CircleCI 2.0 are better handled through workflows. + # See the documentation for more information https://circleci.com/docs/2.0/workflows/ + # Teardown + # If you break your build into multiple jobs with workflows, you will probably want to do the parts of this that are relevant in each + # Save test results + - store_test_results: + path: /tmp/circleci-test-results + # Save artifacts + - store_artifacts: + path: /tmp/circleci-artifacts + - store_artifacts: + path: /tmp/circleci-test-results From 163b46c656ca80a1eb35c6cdb5d3d30855050065 Mon Sep 17 00:00:00 2001 From: Nick Schot Date: Thu, 24 Jan 2019 12:16:12 +0100 Subject: [PATCH 15/17] Restart circle From 6ef01e519aa5d6c85fe10a636514ce6176f544cc Mon Sep 17 00:00:00 2001 From: Nick Schot Date: Thu, 24 Jan 2019 12:17:05 +0100 Subject: [PATCH 16/17] remove nvm --- .circleci/config.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 67655143..009ac253 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -52,10 +52,6 @@ jobs: # In many cases you can simplify this from what is generated here. # 'See docs on artifact collection here https://circleci.com/docs/2.0/artifacts/' - run: mkdir -p $CIRCLE_ARTIFACTS $CIRCLE_TEST_REPORTS - # This is based on your 1.0 configuration file or project settings - - run: - working_directory: ~/lux - command: nvm install 6 && nvm alias default 6 # Dependencies # This would typically go in either a build or a build-and-test job when using workflows # Restore the dependency cache From f8ecbb687d5db424b6b04d1e4489918fd2587e60 Mon Sep 17 00:00:00 2001 From: Nick Schot Date: Thu, 24 Jan 2019 12:19:30 +0100 Subject: [PATCH 17/17] remove global lux --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 009ac253..d7bdb13f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -83,6 +83,7 @@ jobs: cd ../lux # This is based on your 1.0 configuration file or project settings + - run: npm uninstall -g lux-framework - run: npm install - run: npm link # This is based on your 1.0 configuration file or project settings