version: 2.1 orbs: run-with-retry: kimh/run-with-retry@1.0.0 commands: setup_deps: description: 'Setup cache and do a yarn install' steps: - checkout - restore_cache: keys: - v1-npm-{{checksum ".circleci/config.yml"}}-{{checksum "yarn.lock"}} - v1-npm-{{checksum ".circleci/config.yml"}} - run: name: Install dependencies command: yarn jobs: node-latest: &test docker: - image: circleci/node:stretch working_directory: ~/cli steps: - setup_deps - run: ./bin/run --version - run: ./bin/run --help - run-with-retry/run-with-retry: sleep: 2 command: yarn test --ci - run: name: Sending to codecov command: yarn codecov node-12: <<: *test docker: - image: circleci/node:12-stretch node-10: <<: *test docker: - image: circleci/node:10-stretch prettier: <<: *test steps: - setup_deps - run: name: Check prettier command: yarn format:check lint: <<: *test steps: - setup_deps - run: name: Check lint command: yarn lint cache: <<: *test steps: - checkout - run: name: Install dependencies command: yarn - save_cache: key: v1-npm-{{checksum ".circleci/config.yml"}}-{{checksum "yarn.lock"}} paths: - ~/cli/node_modules - /usr/local/share/.cache/yarn - /usr/local/share/.config/yarn release: <<: *test steps: - setup_deps - run: name: release command: yarn release || true workflows: version: 2 nbx: jobs: - node-latest - node-12 - node-10 - prettier - lint - cache: filters: tags: only: /^v.*/ branches: only: master - release: requires: - node-latest - node-12 - node-10 - lint - prettier filters: branches: only: master