Skip to content

Feature/circleci fix #9

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Oct 22, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 27 additions & 52 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,65 +1,40 @@
---
version: 2
jobs:
node-latest: &test
build_and_test:
working_directory: ~/mern-starter
# The primary container is an instance of the first image listed. The job's commands run in this container.
docker:
- image: node:latest
working_directory: ~/cli
- image: circleci/node:latest
# The secondary container is an instance of the second listed image which is run in a common network where ports exposed on the primary container are available on localhost.
steps:
- checkout
- restore_cache: &restore_cache
keys:
- v1-npm-{{checksum ".circleci/config.yml"}}-{{ checksum "package-lock.json"}}
- v1-npm-{{checksum ".circleci/config.yml"}}
- run:
name: Install dependencies
command: .circleci/greenkeeper
- run: ./bin/run --version
- run: ./bin/run --help
name: Update npm
command: 'sudo npm install -g npm@latest'
- restore_cache:
key: dependency-cache-{{ checksum "package-lock.json" }}
- run:
name: Testing
command: npm test
- run:
name: Submitting code coverage to codecov
command: |
./node_modules/.bin/nyc report --reporter text-lcov > coverage.lcov
curl -s https://codecov.io/bash | bash
node-8:
<<: *test
docker:
- image: node:8
release:
<<: *test
steps:
- add_ssh_keys
- checkout
- restore_cache: *restore_cache
- run:
name: Install dependencies
command: |
npm install -g @oclif/semantic-release@3 semantic-release@15
npm install
- run:
name: Cutting release
command: |
semantic-release -e @oclif/semantic-release
name: Install npm dependencies
command: npm install
- save_cache:
key: v1-npm-{{checksum ".circleci/config.yml"}}-{{checksum "package-lock.json"}}
key: dependency-cache-{{ checksum "package-lock.json" }}
paths:
- ~/cli/node_modules
- ~/.npm
- /usr/local/lib/node_modules
- node_modules
- run:
name: Test
command: npm test
- run:
name: Generate code coverage
command: './node_modules/.bin/nyc report --reporter=text-lcov'
- store_artifacts:
path: test-results.xml
prefix: tests
- store_artifacts:
path: coverage
prefix: coverage

workflows:
version: 2
"cdt":
build_and_test:
jobs:
- node-latest
- node-8
- release:
context: org-global
filters:
branches: {only: master}
requires:
- node-latest
- node-8
- build_and_test
61 changes: 61 additions & 0 deletions .circleci/config_2jobs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
version: 2
jobs:
build:
working_directory: ~/mern-starter
# The primary container is an instance of the first image listed. The job's commands run in this container.
docker:
- image: circleci/node:latest
# The secondary container is an instance of the second listed image which is run in a common network where ports exposed on the primary container are available on localhost.
steps:
- checkout
- run:
name: Update npm
command: 'sudo npm install -g npm@latest'
- restore_cache:
key: dependency-cache-{{ checksum "package-lock.json" }}
- run:
name: Install npm dependencies
command: npm install
- save_cache:
key: dependency-cache-{{ checksum "package-lock.json" }}
paths:
- node_modules
test:
docker:
- image: circleci/node:latest
steps:
- checkout
# needed to add here also as both install and test are different docker instances and need to do same thing again in different instance
- run:
name: Update npm
command: 'sudo npm install -g npm@latest'
- restore_cache:
key: dependency-cache-{{ checksum "package-lock.json" }}
- run:
name: Install npm dependencies
command: npm install
- save_cache:
key: dependency-cache-{{ checksum "package-lock.json" }}
paths:
- node_modules
- run:
name: Test
command: npm test
- run:
name: Generate code coverage
command: './node_modules/.bin/nyc report --reporter=text-lcov'
- store_artifacts:
path: test-results.xml
prefix: tests
- store_artifacts:
path: coverage
prefix: coverage

workflows:
version: 2
build_and_test:
jobs:
- build
- test:
requires:
- build
64 changes: 64 additions & 0 deletions .circleci/config_tmp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
version: 2
jobs:
node-latest: &test
docker:
- image: node:latest
working_directory: ~/cli
steps:
- checkout
- restore_cache: &restore_cache
keys:
- v1-npm-{{checksum ".circleci/config_tmp.yml"}}-{{ checksum "package-lock.json"}}
- v1-npm-{{checksum ".circleci/config_tmp.yml"}}
- run:
name: Install dependencies
command: .circleci/greenkeeper
- run: ./bin/run --version
- run: ./bin/run --help
- run:
name: Testing
command: npm test
- run:
name: Submitting code coverage to codecov
command: |
./node_modules/.bin/nyc report --reporter text-lcov > coverage.lcov
curl -s https://codecov.io/bash | bash
node-8:
<<: *test
docker:
- image: node:8
release:
<<: *test
steps:
- add_ssh_keys
- checkout
- restore_cache: *restore_cache
- run:
name: Install dependencies
command: |
npm install -g @oclif/semantic-release@3 semantic-release@15
npm install
- run:
name: Cutting release
command: |
semantic-release -e @oclif/semantic-release
- save_cache:
key: v1-npm-{{checksum ".circleci/config_tmp.yml"}}-{{checksum "package-lock.json"}}
paths:
- ~/cli/node_modules
- ~/.npm
- /usr/local/lib/node_modules

workflows:
version: 2
"cdt":
jobs:
- node-latest
- node-8
- release:
context: org-global
filters:
branches: {only: master}
requires:
- node-latest
- node-8
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"@oclif/config": "^1.13.3",
"@oclif/plugin-help": "^2.2.1",
"jshashes": "^1.0.7",
"tslib": "^1.10.0"
"tslib": "^1.10.0",
"nyc": "^13.3.0"
},
"devDependencies": {
"@oclif/dev-cli": "^1.22.2",
Expand All @@ -24,7 +25,6 @@
"chai": "^4.2.0",
"globby": "^10.0.1",
"mocha": "^5.2.0",
"nyc": "^13.3.0",
"ts-node": "^8.4.1",
"tslint": "^5.20.0",
"typescript": "^3.6.4"
Expand Down Expand Up @@ -56,7 +56,7 @@
"postpack": "rm -f oclif.manifest.json",
"posttest": "tslint -p test -t stylish",
"prepack": "rm -rf lib && tsc -b && oclif-dev manifest && oclif-dev readme",
"test": "nyc --extension .ts mocha --forbid-only \"test/**/*.test.ts\"",
"test": "./node_modules/.bin/nyc --extension .ts mocha --forbid-only \"test/**/*.test.ts\"",
"version": "oclif-dev readme && git add README.md"
},
"types": "lib/index.d.ts"
Expand Down
3 changes: 1 addition & 2 deletions src/commands/hash.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ export default class Hash extends Command {
} else
str = args.string

this.log(str)
this.calculateHash(type, str)
}

Expand Down Expand Up @@ -61,7 +60,7 @@ export default class Hash extends Command {

if (hash) {
let hashed: string = hash.hex(str)
this.log(`[HASH]: ${hashed}`)
this.log(`[${type.toUpperCase()}]: ${hashed}`)
} else {
this.log('[ERROR]: invalid hash type')
}
Expand Down
31 changes: 0 additions & 31 deletions src/commands/hello.ts

This file was deleted.

17 changes: 0 additions & 17 deletions test/commands/hello.test.ts

This file was deleted.