diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..c6e7a72 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,44 @@ +version: 2 +jobs: + build: + working_directory: ~/workspace + docker: + - image: circleci/node:8.9.4 + steps: + - checkout + - run: + name: Configure Git + command: | + git config --global user.name 'CircleCI' + git config --global user.email 's+circleci@sugarshin.net' + - restore_cache: + name: Restoring Cache - dependencies + keys: + - v1-dependencies-{{ .Branch }}-{{ checksum "yarn.lock" }} + - v1-dependencies- + - run: + name: System information + command: | + echo "Node.js $(node -v)" + echo "npm $(npm -v)" + echo "Yarn v$(yarn --version)" + - run: + name: Install dependencies + command: yarn + - run: + name: Tests + command: | + npm run lint + npm run type + npm run test:coverage:report + - save_cache: + paths: + - ~/workspace/node_modules + - ~/.cache/yarn/ + key: v1-dependencies-{{ .Branch }}-{{ checksum "yarn.lock" }} + - deploy: + command: | + if [ "${CIRCLE_BRANCH}" == "master" ]; then + npm run build:demo + npm run deploy + fi diff --git a/circle.yml b/circle.yml deleted file mode 100644 index 74c22cb..0000000 --- a/circle.yml +++ /dev/null @@ -1,31 +0,0 @@ -machine: - timezone: UTC - node: - version: 8.9.4 - pre: - - git config --global user.name "CircleCI" - - git config --global user.email "s+circleci@sugarshin.net" - post: - - curl -o- -L https://yarnpkg.com/install.sh | bash -general: - branches: - ignore: - - gh-pages -dependencies: - pre: - - yarn --version - override: - - yarn - cache_directories: - - "~/.cache/yarn" -test: - override: - - npm run lint - - npm run type - - npm run test:coverage:report -deployment: - master: - branch: master - commands: - - npm run build:demo - - npm run deploy