Skip to content

Commit

Permalink
Test support
Browse files Browse the repository at this point in the history
  • Loading branch information
koblas committed Apr 15, 2020
1 parent 200222c commit 42909cb
Show file tree
Hide file tree
Showing 11 changed files with 5,630 additions and 61 deletions.
77 changes: 77 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# Javascript Node CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-javascript/ for more details
#

version: 2

defaults: &defaults
working_directory: ~/repo
docker:
- image: circleci/node:10.15.0

jobs:
test:
<<: *defaults
steps:
- checkout

- restore_cache:
keys:
- v1-dependencies-
# fallback to using the latest cache if no exact match is found
- v1-dependencies-

- run: npm install --no-package-lock

- run:
name: Run tests
command: npm test

- run:
name: Run build
command: npm run build

- save_cache:
paths:
- node_modules
key: v1-dependencies-

- persist_to_workspace:
root: ~/repo
paths:
- lib
- package*
- node_modules
- LICENSE.txt
- README.md

deploy:
<<: *defaults
steps:
- attach_workspace:
at: ~/repo
- run:
name: Authenticate with registry
command: echo "//registry.npmjs.org/:_authToken=$npm_TOKEN" > ~/repo/.npmrc
- run:
name: Publish package
command: npm publish

workflows:
version: 2
test-deploy:
jobs:
- test:
filters:
tags:
only: /^v.*/

- deploy:
requires:
- test
filters:
tags:
only: /^v.*/
branches:
ignore: /.*/
Loading

0 comments on commit 42909cb

Please sign in to comment.