Skip to content

Commit

Permalink
Merge pull request #2 from scalio/circleci
Browse files Browse the repository at this point in the history
ci: create circleci workflows for publishing and premerge checks
  • Loading branch information
amkartashov authored Aug 19, 2019
2 parents 2c4c95d + 4062826 commit 35a5a97
Show file tree
Hide file tree
Showing 2 changed files with 93 additions and 0 deletions.
91 changes: 91 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
references:
master_only: &master_only
filters:
branches:
only: master
versions_only: &versions_only
filters:
tags:
only: /^v.*/
branches:
ignore: /.*/
not_master_branch: &not_master_branch
filters:
branches:
ignore: master

npm_cache_key: &npm_cache_key
v1-dependency-npm-{{ checksum "yarn.lock" }}
npm_backup_cache_key: &npm_backup_cache_key
v1-dependency-npm

restore_node_modules: &restore_node_modules
restore_cache:
name: Restore node_modules from cache
keys:
- *npm_cache_key
- *npm_backup_cache_key

save_node_modules: &save_node_modules
save_cache:
name: Save node_modules to cache
key: *npm_cache_key
paths:
- node_modules

version: 2

workflows:
version: 2
# every commit to master is checked
master_lint_test_build:
jobs:
- lint_test_build:
<<: *master_only
# every version (tagged commit) is published
publish:
jobs:
- publish:
<<: *versions_only
context: scalio-github-registry
# every commit to branch which has PR is checked (CircleCI option 'Only build Pull Requests' should be enabled)
premerge_check:
jobs:
- lint_test_build:
<<: *not_master_branch

jobs:

publish:
docker:
- image: node:12
steps:
- checkout
- *restore_node_modules
- run: yarn --frozen-lockfile
- *save_node_modules
- run: yarn build
- run:
name: configure access to GitHub NPM registry
command: |
echo "@scalio:registry=https://npm.pkg.github.com/" >> ~/.npmrc
echo "//npm.pkg.github.com/:_authToken=${GITHUB_TOKEN}" >> ~/.npmrc
- run: yarn publish --new-version ${CIRCLE_TAG} dist

lint_test_build:
docker:
- image: node:12
- image: couchdb:latest
environment:
COUCHDB_PASSWORD: -pbkdf2-847043acc65626c8eb98da6d78682fbc493a1787,f7b1a3e4b624f4f0bbfe87e96841eda0,10
COUCHDB_SECRET: 0123456789abcdef0123456789abcdef
COUCHDB_USER: couchdb
NODENAME: couchdb-0.docker.com
steps:
- checkout
- *restore_node_modules
- run: yarn --frozen-lockfile
- *save_node_modules
- run: yarn lint
- run: yarn test
- run: yarn build
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
## Description

[![CircleCI](https://circleci.com/gh/scalio/nest-couchdb/tree/master.svg?style=svg)](https://circleci.com/gh/scalio/nest-couchdb/tree/master)

The [CouchDB](http://couchdb.apache.org/) module for Nest framework

## Installation
Expand Down

0 comments on commit 35a5a97

Please sign in to comment.