Skip to content

Commit

Permalink
ci: set it up (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomaash committed Aug 16, 2019
1 parent 5f842aa commit ae69515
Show file tree
Hide file tree
Showing 7 changed files with 16,447 additions and 4 deletions.
117 changes: 117 additions & 0 deletions .circleci/config.yml
@@ -0,0 +1,117 @@
version: 2.1

executors:
node:
docker:
- image: circleci/node:12.7
working_directory: ~/repo
environment:
GIT_AUTHOR_EMAIL: visjsbot@gmail.com
GIT_AUTHOR_NAME: vis-bot
GIT_COMMITTER_EMAIL: visjsbot@gmail.com
GIT_COMMITTER_NAME: vis-bot

jobs:
prepare:
executor: node

steps:
- checkout

# Download and cache dependencies
- restore_cache:
keys:
- v1-dependencies-{{ checksum "package.json" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-

- run: npm ci

- save_cache:
paths:
- node_modules
key: v1-dependencies-{{ checksum "package.json" }}

- persist_to_workspace:
root: .
paths:
- '*'

build:
executor: node

steps:
- attach_workspace:
at: .

- run: npm run build

- persist_to_workspace:
root: .
paths:
- 'dist'

lint:
executor: node

steps:
- attach_workspace:
at: .

- run: npm run lint

test:
executor: node

steps:
- attach_workspace:
at: .

- run: npm run test-cov

release:
executor: node

steps:
- attach_workspace:
at: .

- run:
name: Prepare NPM
command: |
npm set //registry.npmjs.org/:_authToken=$NPM_TOKEN
- run:
name: Release
command: |
npx semantic-release
workflows:
version: 2

build:
jobs:
- prepare

- build:
requires:
- prepare

- lint:
requires:
- prepare

- test:
requires:
- prepare

- release:
requires:
- prepare
- build
- lint
- test
filters:
branches:
only:
- master
3 changes: 3 additions & 0 deletions .commitlintrc.js
@@ -0,0 +1,3 @@
module.exports = {
extends: ['@commitlint/config-conventional'],
}
1 change: 0 additions & 1 deletion .gitignore
Expand Up @@ -16,4 +16,3 @@ npm-debug.log
gen/
.nyc_output/
coverage/
package-lock.json
3 changes: 3 additions & 0 deletions .lintstagedrc
@@ -0,0 +1,3 @@
{
"{src,test}/*.{j,t}s": ["eslint --fix", "git add"]
}
6 changes: 6 additions & 0 deletions .releaserc.yml
@@ -0,0 +1,6 @@
branch: master
plugins:
- '@semantic-release/commit-analyzer'
- '@semantic-release/release-notes-generator'
- '@semantic-release/npm'
- '@semantic-release/github'

0 comments on commit ae69515

Please sign in to comment.