From 6a476876b1c5e4fae9bd7f0de8bdc9e2073346ba Mon Sep 17 00:00:00 2001 From: Antoine Roy-Gobeil Date: Thu, 22 Nov 2018 15:13:26 -0500 Subject: [PATCH 1/2] add circleCI integration --- .circleci/config.yml | 60 ++++++++++++++++++++++++++++++++++++++++++++ .gitignore | 1 + 2 files changed, 61 insertions(+) create mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..8535135 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,60 @@ +version: 2.0 + +# Inspired by: +# https://github.com/CircleCI-Public/circleci-demo-workflows/blob/workspace-forwarding/.circleci/config.yml +# https://circleci.com/docs/2.0/workflows/#using-workspaces-to-share-data-among-jobs +# +# For list of official CircleCI node.js images, go to: +# https://hub.docker.com/r/circleci/node/tags/ + +jobs: + build: + docker: + - image: circleci/node:10.9.0 + working_directory: ~/react-plotly.js + steps: + - checkout + - restore_cache: + keys: + - v{{ .Environment.CIRCLE_CACHE_VERSION }}-deps-{{ .Branch }}-{{ checksum "package-lock.json" }} + - v{{ .Environment.CIRCLE_CACHE_VERSION }}-deps-master-{{ checksum "package-lock.json" }} + - run: + name: Install dependencies + command: | + npm install + - run: + name: List dependency versions + command: | + echo "npm: $(npm --version)" + echo "node: $(node --version)" + npm ls || true + - save_cache: + paths: + - node_modules + key: v{{ .Environment.CIRCLE_CACHE_VERSION }}-deps-{{ .Branch }}-{{ checksum "package.json" }} + - persist_to_workspace: + root: . + paths: + - node_modules + + test: + docker: + # need '-browsers' version to test in real (xvfb-wrapped) browsers + - image: circleci/node:10.9.0 + working_directory: ~/react-plotly.js + steps: + - checkout + - attach_workspace: + at: ~/react-plotly.js + - run: + name: Run tests + command: npm run test + +workflows: + version: 2 + build-and-test: + jobs: + - build + - test: + requires: + - build diff --git a/.gitignore b/.gitignore index 0f03570..0b45f15 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ npm-debug.log* *.sublime* .* +!.circleci !.gitignore !.gitattributes !.npmignore From 6007b7ca5c99130548f1aba2647c7705547b0cb5 Mon Sep 17 00:00:00 2001 From: Antoine Roy-Gobeil Date: Thu, 22 Nov 2018 15:27:41 -0500 Subject: [PATCH 2/2] remove old unrelated comments --- .circleci/config.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 8535135..3f1cec9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,12 +1,5 @@ version: 2.0 -# Inspired by: -# https://github.com/CircleCI-Public/circleci-demo-workflows/blob/workspace-forwarding/.circleci/config.yml -# https://circleci.com/docs/2.0/workflows/#using-workspaces-to-share-data-among-jobs -# -# For list of official CircleCI node.js images, go to: -# https://hub.docker.com/r/circleci/node/tags/ - jobs: build: docker: @@ -39,7 +32,6 @@ jobs: test: docker: - # need '-browsers' version to test in real (xvfb-wrapped) browsers - image: circleci/node:10.9.0 working_directory: ~/react-plotly.js steps: