From 72f40100a7629464e370311ad8b13eac6db0b254 Mon Sep 17 00:00:00 2001 From: Guillaume Chau Date: Thu, 8 Nov 2018 22:54:47 -0800 Subject: [PATCH] chore(ci): setup circleci --- .circleci/config.yml | 35 +++++++++++++++++++++++++++++++++++ package.json | 9 +++++---- 2 files changed, 40 insertions(+), 4 deletions(-) create mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..7dc9c17 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,35 @@ +# Javascript Node CircleCI 2.0 configuration file +# +# Check https://circleci.com/docs/2.0/language-javascript/ for more details +# +version: 2 +jobs: + build: + docker: + # specify the version you desire here + - image: circleci/node:8.12 + + working_directory: ~/repo + + steps: + - checkout + + # Download and cache dependencies + - restore_cache: + keys: + - v1-dependencies-{{ checksum "yarn.lock" }} + # fallback to using the latest cache if no exact match is found + - v1-dependencies- + + - run: yarn install && cd tests/demo && yarn install + + - save_cache: + paths: + - node_modules + - tests/demo/node_modules + key: v1-dependencies-{{ checksum "yarn.lock" }} + + # run tests! + - run: yarn test + + diff --git a/package.json b/package.json index f5fe938..dce7e1b 100644 --- a/package.json +++ b/package.json @@ -7,15 +7,16 @@ "unpkg": "dist/vue-apollo.min.js", "typings": "types/index.d.ts", "scripts": { - "build": "npm run build:browser && npm run build:es && npm run build:umd", + "build": "yarn build:browser && yarn build:es && yarn build:umd", "build:browser": "rollup --config build/rollup.config.browser.js", "build:es": "rollup --config build/rollup.config.es.js", "build:umd": "rollup --config build/rollup.config.umd.js", - "prepublishOnly": "npm run test && npm run build", - "dev": "nodemon --exec 'npm run build:es && npm run build:umd' --watch src", - "test": "npm run test:eslint && npm run test:types", + "prepublishOnly": "yarn test && yarn build", + "dev": "nodemon --exec 'yarn build:es && yarn build:umd' --watch src", + "test": "yarn build && yarn test:eslint && yarn test:types && yarn test:e2e", "test:eslint": "eslint --ext .js {src,ssr,lib,build}/**/*.js", "test:types": "tsc -p types/test", + "test:e2e": "cd tests/demo && yarn test", "docs:dev": "vuepress dev docs", "docs:build": "vuepress build docs" },