diff --git a/templates/circle.yml.ejs b/templates/circle.yml.ejs index ef8920b..bdf536d 100644 --- a/templates/circle.yml.ejs +++ b/templates/circle.yml.ejs @@ -1,3 +1,12 @@ +<%_ +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: @@ -5,6 +14,8 @@ jobs: docker: - image: node:latest working_directory: ~/cli + environment: + NYC: yarn exec nyc -- --nycrc-path node_modules/@anycli/nyc-config/.nycrc steps: - checkout - restore_cache: &restore_cache @@ -14,7 +25,7 @@ jobs: - v0 - run: .circleci/setup_git - run: .circleci/greenkeeper - - run: yarn add -D nyc@11 @anycli/nyc-config@0 mocha-junit-reporter@1<%- semantic_release ? " @commitlint/cli@6 @commitlint/config-conventional@6" : "" %> + - run: yarn add -D <%- deps %> <%_ if (mocha) { _%> - run: name: yarn test @@ -22,12 +33,12 @@ jobs: environment: {MOCHA_FILE: reports/mocha.xml} command: | mkdir -p reports - yarn exec nyc -- --nycrc-path node_modules/@anycli/nyc-config/.nycrc yarn test --reporter mocha-junit-reporter + $NYC yarn test --reporter mocha-junit-reporter - run: name: submit code coverage command: | - yarn exec nyc -- --nycrc-path node_modules/@anycli/nyc-config/.nycrc report --reporter text-lcov > coverage.lcov - curl -s https://codecov.io/bash | bash + $NYC report --reporter text-lcov > coverage.lcov + curl -s https://codecov.io/bash | bash <%_ } else { _%> - run: yarn test <%_ } _%>