<%_ let deps = [ 'nyc@11', '@anycli/nyc-config@0', 'mocha-junit-reporter@1', ] if (semantic_release) deps.push('@commitlint/cli@6', '@commitlint/config-conventional@6') deps = deps.join(' ') _%> --- version: 2 jobs: node-latest: &test docker: - image: node:latest working_directory: ~/cli environment: <%_ if (mocha) { _%> NYC: "yarn exec nyc -- --nycrc-path node_modules/@anycli/nyc-config/.nycrc" MOCHA_FILE: "reports/mocha.xml" <%_ } _%> steps: - checkout - restore_cache: &restore_cache keys: - v0-yarn-{{checksum ".circleci/config.yml"}}-{{ checksum "yarn.lock"}} - v0-yarn-{{checksum ".circleci/config.yml"}} - run: .circleci/greenkeeper - run: yarn add -D <%- deps %> <%_ if (['single', 'multi'].includes(type)) { _%> - run: ./bin/run -v <%_ } _%> <%_ if (['single', 'multi', 'plugin'].includes(type)) { _%> - run: ./bin/run --help <%_ } _%> <%_ if (mocha) { _%> - run: | mkdir -p reports $NYC yarn test --reporter mocha-junit-reporter $NYC report --reporter text-lcov > coverage.lcov curl -s https://codecov.io/bash | bash <%_ } else { _%> - run: yarn test <%_ } _%> <%_ if (semantic_release) { _%> - run: yarn exec commitlint -- -x @commitlint/config-conventional --from origin/master <%_ } _%> - store_test_results: &store_test_results path: ~/cli/reports node-8: <<: *test docker: - image: node:8 <%_ if (semantic_release) { _%> release: <<: *test steps: - add_ssh_keys - checkout - restore_cache: *restore_cache - run: yarn global add @anycli/semantic-release@1 semantic-release@12 - run: yarn --frozen-lockfile - run: | export PATH=/usr/local/share/.config/yarn/global/node_modules/.bin:$PATH semantic-release -e @anycli/semantic-release - save_cache: key: v0-yarn-{{checksum ".circleci/config.yml"}}-{{checksum "yarn.lock"}} paths: - ~/cli/node_modules - /usr/local/share/.cache/yarn - /usr/local/share/.config/yarn <%_ } _%> workflows: version: 2 "<%= pjson.name %>": jobs: - node-latest - node-8 <%_ if (semantic_release) { _%> - release: context: org-global filters: branches: {only: master} requires: - node-latest - node-8 <%_ } _%>