diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..3f1cec9 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,52 @@ +version: 2.0 + +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: + - 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