Skip to content

Commit

Permalink
Feature/fix for circle (#2) (#3)
Browse files Browse the repository at this point in the history
* Feature/fix for circle (#2)

* Changes for public npm repos.

* Added public access to the npm publish command

* feature/continuous Integration v2 (#4)

* final draft circleci v2 config 10:19:31

* final draft circleci v2 config 10:26:50

* final draft circleci v2 config 11:06:34
  • Loading branch information
mdebarros authored and Bill Hodghead committed Dec 28, 2017
1 parent ec81efc commit 135f1db
Show file tree
Hide file tree
Showing 3 changed files with 106 additions and 30 deletions.
105 changes: 105 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
# CircleCI v2 Config
version: 2

defaults: &defaults
working_directory: /home/circleci/project
docker:
- image: circleci/node:6.10.3

jobs:
setup:
<<: *defaults
steps:
- checkout
- run:
name: Update NPM install
command: sudo npm install
- save_cache:
key: dependency-cache-{{ checksum "package.json" }}
paths:
- node_modules
test-unit:
<<: *defaults
steps:
- checkout
- restore_cache:
key: dependency-cache-{{ checksum "package.json" }}
- run:
name: Create dir for test results
command: mkdir -p ./test/results
- run:
name: Execute unit tests
command: npm -s run test:xunit > ./test/results/tape.xml
- store_artifacts:
path: ./test/results
prefix: test
- store_test_results:
path: ./test/results
test-coverage:
<<: *defaults
steps:
- checkout
- restore_cache:
key: dependency-cache-{{ checksum "package.json" }}
- run:
name: Execute code coverage check
command: npm -s run test:coverage-check
- store_artifacts:
path: coverage
prefix: test
- store_test_results:
path: coverage/lcov.info
deploy:
<<: *defaults
steps:
- checkout
- restore_cache:
key: dependency-cache-{{ checksum "package.json" }}
- run:
name: Update NPM registry auth token
command: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc
- run:
name: Publish NPM artifact
command: npm publish --access public

workflows:
version: 2
build_and_test:
jobs:
- setup:
context: org-global
filters:
branches:
ignore:
- /feature*/
- /bugfix*/
- test-unit:
context: org-global
requires:
- setup
filters:
branches:
ignore:
- /feature*/
- /bugfix*/
- test-coverage:
context: org-global
requires:
- setup
filters:
branches:
ignore:
- /feature*/
- /bugfix*/
- deploy:
context: org-global
requires:
- setup
- test-unit
- test-coverage
filters:
tags:
only: /v[0-9]+(\.[0-9]+)*/
branches:
only:
- master
29 changes: 0 additions & 29 deletions circle.yml

This file was deleted.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@
"tapes": "4.1.0"
},
"publishConfig": {
"registry": "https://modusbox.jfrog.io/modusbox/api/npm/level1-npm-release"
"registry": "https://registry.npmjs.org/"
}
}

0 comments on commit 135f1db

Please sign in to comment.