Skip to content

Commit

Permalink
Merge pull request #38 from dannyrb/ci/setup-semantic-release
Browse files Browse the repository at this point in the history
ci: setup semantic release
  • Loading branch information
dannyrb authored Sep 13, 2019
2 parents e1c0376 + 1ebe923 commit 097dab5
Show file tree
Hide file tree
Showing 13 changed files with 42,369 additions and 24,726 deletions.
91 changes: 91 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# Use the latest 2.1 version of CircleCI pipeline processing engine, see https://circleci.com/docs/2.0/configuration-reference/
version: 2.1

defaults: &defaults
working_directory: ~/repo
# https://circleci.com/docs/2.0/circleci-images/#language-image-variants
docker:
- image: circleci/node:10.15.1
environment:
TERM: xterm # Enable colors in term

jobs:
CHECKOUT:
<<: *defaults
steps:
- checkout
- restore_cache:
name: Restore Package Cache
keys:
- packages-v1-{{ .Branch }}-{{ checksum "package.json" }}
- packages-v1-{{ .Branch }}-
- packages-v1-
- run: npm ci
- save_cache:
name: Save Package Cache
paths:
- ~/repo/node_modules
key: packages-v1-{{ .Branch }}-{{ checksum "package.json" }}
- persist_to_workspace:
root: ~/repo
paths: .

BUILD_AND_TEST:
<<: *defaults
steps:
- attach_workspace:
at: ~/repo
- run: npm run build && npm run test
# https://circleci.com/docs/2.0/collect-test-data/#karma
# - store_test_results:
# path: reports/junit
# - store_artifacts:
# path: reports/junit
- persist_to_workspace:
root: ~/repo
paths: .

NPM_PUBLISH:
<<: *defaults
steps:
- attach_workspace:
at: ~/repo
- run:
name: Avoid hosts unknown for github
command:
mkdir ~/.ssh/ && echo -e "Host github.com\n\tStrictHostKeyChecking
no\n" > ~/.ssh/config
- run:
name: Publish using Semantic Release
command: npx semantic-release

workflows:
version: 2

# PULL REQUEST
PULL_REQUEST:
jobs:
- CHECKOUT:
filters:
branches:
ignore:
- master
- feature/*
- hotfix/*
- BUILD_AND_TEST:
requires:
- CHECKOUT

# MERGE TO MASTER
TEST_AND_RELEASE:
jobs:
- CHECKOUT:
filters:
branches:
only: master
- BUILD_AND_TEST:
requires:
- CHECKOUT
- NPM_PUBLISH:
requires:
- BUILD_AND_TEST
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@ yarn-debug.log*
yarn-error.log*
.idea
.yalc
yalc.lock
yalc.lock
yarn.lock
4 changes: 3 additions & 1 deletion example/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@ public/cornerstoneWADOImageLoader.min.js
public/cornerstoneWADOImageLoader.min.js.map
public/cornerstoneWADOImageLoaderCodecs.min.js
public/cornerstoneWADOImageLoaderWebWorker.min.js
public/cornerstoneWADOImageLoaderWebWorker.min.js.map
public/cornerstoneWADOImageLoaderWebWorker.min.js.map

yarn.lock
Loading

0 comments on commit 097dab5

Please sign in to comment.