diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000000..b39fd4acd6 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,77 @@ +version: 2.1 +executors: + node-10: + docker: + - image: circleci/node:10 + +jobs: + install-dependencies: + executor: node-10 + steps: + - checkout + - restore_cache: + keys: + # if lock file changes, we still use increasingly general patterns to restore cache + - yarn-cache-lib-{{ .Branch }}-{{ checksum "yarn.lock" }} + - yarn-cache-lib-{{ .Branch }}- + - run: + name: Install dependencies + command: | + yarn --version + yarn install --frozen-lockfile + - save_cache: + key: yarn-cache-lib-{{ .Branch }}-{{ checksum "yarn.lock" }} + paths: + - ~/.yarn + - ~/.cache/yarn + - ./node_modules + - persist_to_workspace: + root: . + paths: . + + test-library: + executor: node-10 + steps: + - attach_workspace: + at: . + - run: + name: Test Library + command: yarn test:ci + + install-test-example: + executor: node-10 + steps: + - attach_workspace: + at: . + - restore_cache: + keys: + - yarn-cache-example-{{ .Branch }}-{{ checksum "yarn.lock" }} + - yarn-cache-example-{{ .Branch }}- + - run: + name: Install Example Dependencies + command: | + cd example + yarn install --frozen-lockfile + - save_cache: + key: yarn-cache-example-{{ .Branch }}-{{ checksum "yarn.lock" }} + paths: + - ./example/node_modules + - run: + name: Test Example + command: | + cd example + yarn test:ci + yarn test:coverage + +workflows: + version: 2 + install-and-test: + jobs: + - install-dependencies + - test-library: + requires: + - install-dependencies + - install-test-example: + requires: + - install-dependencies + diff --git a/circle.yml b/circle.yml deleted file mode 100644 index 2fad34f39d..0000000000 --- a/circle.yml +++ /dev/null @@ -1,23 +0,0 @@ -machine: - environment: - YARN_VERSION: 1.3.2 - PATH: "${PATH}:${HOME}/.yarn/bin:${HOME}/${CIRCLE_PROJECT_REPONAME}/node_modules/.bin" - node: - version: 8.9.3 -dependencies: - pre: - - | - if [[ ! -e ~/.yarn/bin/yarn || $(yarn --version) != "${YARN_VERSION}" ]]; then - curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version $YARN_VERSION - fi - - cache_directories: - - ~/.yarn - - ~/.cache/yarn - override: - - yarn install --no-progress - - cd example && yarn install --no-progress -test: - override: - - yarn run test:ci - - cd example && yarn run test:ci && yarn run test:coverage