Skip to content

Commit

Permalink
fix: use new circle config
Browse files Browse the repository at this point in the history
  • Loading branch information
jdx committed Feb 1, 2018
1 parent 2b79793 commit 2c9d9c7
Show file tree
Hide file tree
Showing 8 changed files with 81 additions and 425 deletions.
47 changes: 32 additions & 15 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,45 +11,43 @@ jobs:
- checkout
- restore_cache: &restore_cache
keys:
- v1-yarn-{{checksum ".circleci/config.yml"}}-{{ .Branch }}-{{checksum "yarn.lock"}}
- v1-yarn-{{checksum ".circleci/config.yml"}}-{{ .Branch }}-
- v1-yarn-{{checksum ".circleci/config.yml"}}-master-
- run: .circleci/yarn
- v0-{{checksum ".circleci/config.yml"}}-{{ checksum "yarn.lock"}}
- v0-{{checksum ".circleci/config.yml"}}
- v0
- run: .circleci/greenkeeper
- run: .circleci/setup_git
- run: yarn --frozen-lockfile
- run: yarn exec nps test.multi
- store_test_results: &store_test_results
path: ~/cli/reports
- save_cache:
key: v1-yarn-{{checksum ".circleci/config.yml"}}-{{ .Branch }}-{{checksum "yarn.lock"}}
paths:
- ~/cli/node_modules
- /usr/local/share/.cache/yarn
- /usr/local/share/.config/yarn
node-latest-base:
<<: *test
steps: &base_steps
- checkout
- restore_cache: *restore_cache
- run: .circleci/yarn
- run: .circleci/greenkeeper
- run: .circleci/setup_git
- run: yarn --frozen-lockfile
- run: yarn exec nps test.base
- store_test_results: *store_test_results
node-latest-plugin:
<<: *test
steps: &plugin_steps
- checkout
- restore_cache: *restore_cache
- run: .circleci/yarn
- run: .circleci/greenkeeper
- run: .circleci/setup_git
- run: yarn --frozen-lockfile
- run: yarn exec nps test.plugin
- store_test_results: *store_test_results
node-latest-single:
<<: *test
steps: &single_steps
- checkout
- restore_cache: *restore_cache
- run: .circleci/yarn
- run: .circleci/greenkeeper
- run: .circleci/setup_git
- run: yarn --frozen-lockfile
- run: yarn exec nps test.single
- store_test_results: *store_test_results
node-latest-command:
Expand All @@ -59,8 +57,9 @@ jobs:
steps: &command_steps
- checkout
- restore_cache: *restore_cache
- run: .circleci/yarn
- run: .circleci/greenkeeper
- run: .circleci/setup_git
- run: yarn --frozen-lockfile
- run: yarn exec nps test.command
- store_test_results: *store_test_results
node-8-base: &node_8
Expand All @@ -84,15 +83,30 @@ jobs:
<<: *node_8
steps: *command_steps

cache:
<<: *test
steps:
- checkout
- run: yarn global add greenkeeper-lockfile@1
- run: yarn add -D nyc@11 @anycli/nyc-config@0 mocha-junit-reporter@1 @commitlint/cli@6 @commitlint/config-conventional@6
- save_cache:
key: v0-{{checksum ".circleci/config.yml"}}-{{checksum "yarn.lock"}}
paths:
- ~/cli/node_modules
- /usr/local/share/.cache/yarn
- /usr/local/share/.config/yarn

lint:
<<: *test
docker:
- image: node:latest
steps:
- checkout
- restore_cache: *restore_cache
- run: .circleci/yarn
- run: .circleci/greenkeeper
- run: .circleci/setup_git
- run: yarn add -D @commitlint/cli@6 @commitlint/config-conventional@6
- run: yarn exec commitlint -- -x @commitlint/config-conventional --from origin/master
- run: yarn exec nps lint
- store_test_results: *store_test_results

Expand All @@ -114,6 +128,9 @@ workflows:
- node-latest-plugin
- node-latest-multi
- node-latest-command
- cache:
filters:
branches: {only: master}
- release:
context: org-global
filters:
Expand Down
18 changes: 18 additions & 0 deletions .circleci/greenkeeper
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env bash

set -ex

PATH=/usr/local/share/.config/yarn/global/node_modules/.bin:$PATH

if [[ "$CIRCLE_BRANCH" != greenkeeper/* ]]; then
yarn check
exit 0
fi

if [[ ! -x "$(command -v greenkeeper-lockfile-update)" ]]; then
yarn global add greenkeeper-lockfile@1
fi

greenkeeper-lockfile-update
yarn install "$CLI_ENGINE_UTIL_YARN_ARGS"
greenkeeper-lockfile-upload
22 changes: 0 additions & 22 deletions .circleci/yarn

This file was deleted.

3 changes: 1 addition & 2 deletions package-scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,8 @@ module.exports = {
scripts: {
build: 'rm -rf lib && tsc',
lint: {
default: concurrent.nps('lint.eslint', 'lint.commitlint', 'lint.tsc', 'lint.tslint'),
default: concurrent.nps('lint.eslint', 'lint.tsc', 'lint.tslint'),
eslint: script('eslint .', 'lint js files'),
commitlint: script('commitlint --from origin/master', 'ensure that commits are in valid conventional-changelog format'),
tsc: script('tsc --noEmit', 'syntax check with tsc'),
tslint: script('tslint -p .', 'lint ts files'),
},
Expand Down
6 changes: 0 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
},
"devDependencies": {
"@anycli/tslint": "^0.2.1",
"@commitlint/cli": "^6.0.5",
"@commitlint/config-conventional": "^6.0.4",
"@types/lodash": "^4.14.100",
"@types/read-pkg": "^3.0.0",
"@types/shelljs": "^0.7.8",
Expand All @@ -36,9 +34,7 @@
"execa": "^0.9.0",
"fancy-test": "^0.6.6",
"fs-extra": "^5.0.0",
"husky": "^0.14.3",
"mocha": "^5.0.0",
"mocha-junit-reporter": "^1.17.0",
"npm-run-path": "^2.0.2",
"nps": "^5.7.1",
"nps-utils": "^1.5.0",
Expand Down Expand Up @@ -69,8 +65,6 @@
"main": "lib/index.js",
"repository": "anycli/cli",
"scripts": {
"commitmsg": "commitlint -x @commitlint/config-conventional -e $GIT_PARAMS",
"precommit": "nps lint -l warn",
"prepublishOnly": "nps build",
"test": "nps test -l warn"
},
Expand Down
4 changes: 2 additions & 2 deletions templates/circle.yml.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ jobs:
<<: *test
steps:
- checkout
- yarn global add greenkeeper-lockfile@1
- yarn add -D nyc@11 @anycli/nyc-config@0 mocha-junit-reporter@1<%- semantic_release ? " @commitlint/cli@6 @commitlint/config-conventional@6" : "" %>
- 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" : "" %>
- save_cache:
key: v0-{{checksum ".circleci/config.yml"}}-{{checksum "yarn.lock"}}
paths:
Expand Down
1 change: 1 addition & 0 deletions templates/scripts/greenkeeper
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ set -ex
PATH=/usr/local/share/.config/yarn/global/node_modules/.bin:$PATH

if [[ "$CIRCLE_BRANCH" != greenkeeper/* ]]; then
yarn check
exit 0
fi

Expand Down

0 comments on commit 2c9d9c7

Please sign in to comment.