Skip to content

Commit

Permalink
fix: fixed yarn step in circle config
Browse files Browse the repository at this point in the history
  • Loading branch information
jdx committed Feb 1, 2018
1 parent 125d03e commit e6e19c4
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 47 deletions.
1 change: 0 additions & 1 deletion .circleci/config.yml
Expand Up @@ -106,7 +106,6 @@ jobs:
- add_ssh_keys
- checkout
- run: .circleci/setup_git
- run: .circleci/release

workflows:
version: 2
Expand Down
6 changes: 3 additions & 3 deletions src/generators/app.ts
Expand Up @@ -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)
Expand Down
88 changes: 46 additions & 42 deletions templates/circle.yml.ejs
Expand Up @@ -15,65 +15,63 @@ 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: |
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
- 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 (['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
node-8:
<<: *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) { _%>
Expand All @@ -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
Expand All @@ -104,4 +103,9 @@ workflows:
requires:
- node-latest
- node-8
- cache: { requires: [release] }
<%_ } else { _%>
- cache:
filters:
branches: {only: master}
<%_ } _%>
1 change: 0 additions & 1 deletion templates/scripts/release
Expand Up @@ -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

0 comments on commit e6e19c4

Please sign in to comment.