--- version: 2 jobs: node-latest: &test docker: - image: node:latest working_directory: ~/cli steps: - checkout - restore_cache: &restore_cache keys: - v1-npm-{{checksum ".circleci/config.yml"}}-{{checksum "<%- yarn ? 'yarn.lock' : 'package-lock.json' %>"}} - v1-npm-{{checksum ".circleci/config.yml"}} - run: name: Install dependencies command: <%- yarn ? 'yarn' : 'npm ci' %> <%_ if (['single', 'multi'].includes(type)) { _%> - run: ./bin/run --version <%_ } _%> <%_ if (['single', 'multi', 'plugin'].includes(type)) { _%> - run: ./bin/run --help <%_ } _%> - run: name: Testing command: <%- yarn ? 'yarn' : 'npm' %> test <%_ if (mocha && codecov) { _%> - run: name: Submitting code coverage to codecov command: | ./node_modules/.bin/nyc report --reporter text-lcov > coverage.lcov curl -s https://codecov.io/bash | bash <%_ } _%> node-12: <<: *test docker: - image: node:12 node-10: <<: *test docker: - image: node:10 cache: <<: *test steps: - checkout - run: name: Install dependencies command: <%- yarn ? 'yarn' : 'npm ci' %> - save_cache: key: v1-npm-{{checksum ".circleci/config.yml"}}-{{checksum "<%- yarn ? 'yarn.lock' : 'package-lock.json' %>"}} paths: - ~/cli/node_modules <%_ if (yarn) { _%> - /usr/local/share/.cache/yarn - /usr/local/share/.config/yarn <%_ } else { _%> - ~/.npm - /usr/local/lib/node_modules <%_ } _%> workflows: version: 2 "<%= pjson.name %>": jobs: - node-latest - node-12 - node-10 - cache: filters: tags: only: /^v.*/ branches: ignore: /.*/