fix: fixed yarn step in circle config
MODIFY
.circleci/config.yml
.circleci/config.yml
@@ -106,7 +106,6 @@ jobs:
- add_ssh_keys
- checkout
- run: .circleci/setup_git
- - run: .circleci/release
workflows:
version: 2

MODIFY
src/generators/app.ts
src/generators/app.ts
@@ -291,9 +291,9 @@ class App extends Generator {
this.fs.writeJSON(this.destinationPath('./package.json'), sortPjson(this.pjson))
this.fs.copyTpl(this.templatePath('editorconfig'), this.destinationPath('.editorconfig'), this)
this.fs.copyTpl(this.templatePath('scripts/greenkeeper'), this.destinationPath('.circleci/greenkeeper'), this)
- if (this.semantic_release) {
- this.fs.copyTpl(this.templatePath('scripts/release'), this.destinationPath('.circleci/release'), this)
- }
+ // if (this.semantic_release) {
+ // this.fs.copyTpl(this.templatePath('scripts/release'), this.destinationPath('.circleci/release'), this)
+ // }
this.fs.copyTpl(this.templatePath('scripts/setup_git'), this.destinationPath('.circleci/setup_git'), this)
this.fs.copyTpl(this.templatePath('README.md.ejs'), this.destinationPath('README.md'), this)
this.fs.copyTpl(this.templatePath('circle.yml.ejs'), this.destinationPath('.circleci/config.yml'), this)

MODIFY
templates/circle.yml.ejs
templates/circle.yml.ejs
@@ -15,48 +15,32 @@ jobs:
- image: node:latest
working_directory: ~/cli
environment:
- NYC: yarn exec nyc -- --nycrc-path node_modules/@anycli/nyc-config/.nycrc
+ DEPS: "<%- deps %>"
+ <%_ 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-{{checksum ".circleci/config.yml"}}-{{ checksum "yarn.lock"}}
- - v0-{{checksum ".circleci/config.yml"}}
- - v0
+ - attach_workspace: {at: node_modules}
- run: .circleci/setup_git
- - run: .circleci/greenkeeper
- - run: yarn add -D <%- deps %>
<%_ if (mocha) { _%>
- - run:
- name: yarn test
- when: always
- environment: {MOCHA_FILE: reports/mocha.xml}
- command: |
+ - run: |
mkdir -p reports
$NYC yarn test --reporter mocha-junit-reporter
- - run:
- name: submit code coverage
- command: |
$NYC report --reporter text-lcov > coverage.lcov
curl -s https://codecov.io/bash | bash
<%_ } else { _%>
- run: yarn test
<%_ } _%>
<%_ if (['single', 'multi', 'plugin'].includes(type)) { _%>
- - run:
- when: always
- command: ./bin/run -v
+ - run: ./bin/run -v
<%_ } _%>
<%_ if (['single', 'multi'].includes(type)) { _%>
- - run:
- when: always
- command: ./bin/run --help
+ - run: ./bin/run --help
<%_ } _%>
<%_ if (semantic_release) { _%>
- - run:
- name: check if commits match conventional-changelog spec
- when: always
- command: yarn exec commitlint -- -x @commitlint/config-conventional --from origin/master
+ - run: yarn exec commitlint -- -x @commitlint/config-conventional --from origin/master
<%_ } _%>
- store_test_results: &store_test_results
path: ~/cli/reports
@@ -64,16 +48,30 @@ jobs:
<<: *test
docker:
- image: node:8
- cache:
+ yarn:
<<: *test
steps:
- checkout
+ - restore_cache:
+ keys:
+ - v0-{{checksum ".circleci/config.yml"}}-{{ checksum "yarn.lock"}}
+ - v0-{{checksum ".circleci/config.yml"}}
+ - v0
+ - run: .circleci/greenkeeper
- run: yarn global add greenkeeper-lockfile@1
- - 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
+ - persist_to_workspace: {root: node_modules, paths: ["*"]}
+ cache:
+ <<: *test
+ steps:
+ - checkout
+ - restore_cache: { keys: [v001-{{checksum ".circleci/config.yml"}}-{{checksum "yarn.lock"}}] }
+ - attach_workspace: {at: node_modules}
+ - run: yarn global add greenkeeper-lockfile@1<%- semantic_release ? '@anycli/semantic-release@1 semantic-release@12' : '' %>
+ - run: yarn add -D $DEPS
- save_cache:
- key: v0-{{checksum ".circleci/config.yml"}}-{{checksum "yarn.lock"}}
+ key: v001-{{checksum ".circleci/config.yml"}}-{{checksum "yarn.lock"}}
paths:
- - ~/cli/node_modules
- /usr/local/share/.cache/yarn
- /usr/local/share/.config/yarn
<%_ if (semantic_release) { _%>
@@ -82,20 +80,21 @@ jobs:
steps:
- add_ssh_keys
- checkout
- - restore_cache: *restore_cache
- - run: .circleci/setup_git
- - run: .circleci/release
+ - attach_workspace: {at: node_modules}
+ - run: |
+ export PATH=/usr/local/share/.config/yarn/global/node_modules/.bin:$PATH
+ .circleci/setup_git
+ yarn global add @anycli/semantic-release@1 semantic-release@12
+ semantic-release -e @anycli/semantic-release
<%_ } _%>
workflows:
version: 2
"<%= pjson.name %>":
jobs:
- - node-latest
- - node-8
- - cache:
- filters:
- branches: {only: master}
+ - yarn
+ - node-latest: {requires: [yarn] }
+ - node-8: {requires: [yarn] }
<%_ if (semantic_release) { _%>
- release:
context: org-global
@@ -104,4 +103,9 @@ workflows:
requires:
- node-latest
- node-8
+ - cache: { requires: [release] }
+<%_ } else { _%>
+ - cache:
+ filters:
+ branches: {only: master}
<%_ } _%>

MODIFY
templates/scripts/release
templates/scripts/release
@@ -5,5 +5,4 @@ set -ex
PATH=/usr/local/share/.config/yarn/global/node_modules/.bin:$PATH
yarn global add @anycli/semantic-release@1 semantic-release@12
-yarn install --frozen-lockfile
semantic-release -e @anycli/semantic-release

fix: fixed yarn step in circle config