-
Notifications
You must be signed in to change notification settings - Fork 600
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Switch from Travis to CircleCI (#473)
- Loading branch information
Showing
3 changed files
with
178 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,151 @@ | ||
version: 2.1 | ||
|
||
orbs: | ||
coveralls: coveralls/[email protected] | ||
puppeteer: threetreeslight/[email protected] | ||
|
||
defaults: &defaults | ||
working_directory: ~/repo | ||
docker: | ||
- image: circleci/node:latest-browsers | ||
|
||
jobs: | ||
checkout_code: | ||
<<: *defaults | ||
steps: | ||
- checkout | ||
- attach_workspace: | ||
at: ~/repo | ||
- restore_cache: | ||
keys: | ||
- v1-dependencies-{{ checksum "package.json" }} | ||
- v1-dependencies- | ||
- puppeteer/install | ||
- run: npm install | ||
- save_cache: | ||
paths: | ||
- node_modules | ||
key: v1-dependencies-{{ checksum "package.json" }} | ||
- persist_to_workspace: | ||
root: ~/repo | ||
paths: . | ||
|
||
test_and_report: | ||
<<: *defaults | ||
steps: | ||
- attach_workspace: | ||
at: ~/repo | ||
- run: npm install | ||
- run: npm rebuild | ||
- run: | ||
name: Install codecov | ||
command: npm install --save-dev codecov | ||
- run: | ||
name: Tests && Codecov Report | ||
command: npm run test | ||
- coveralls/upload | ||
- store_artifacts: | ||
path: ./coverage/ | ||
prefix: tests | ||
- store_artifacts: | ||
path: coverage | ||
prefix: coverage | ||
- store_test_results: | ||
path: ./coverage/ | ||
|
||
build: | ||
<<: *defaults | ||
steps: | ||
- attach_workspace: | ||
at: ~/repo | ||
- run: npm install | ||
- run: npm rebuild | ||
- run: | ||
name: Build our app | ||
command: npm run build | ||
- persist_to_workspace: | ||
root: ~/repo | ||
paths: . | ||
|
||
publish_npm: | ||
<<: *defaults | ||
steps: | ||
- attach_workspace: | ||
at: ~/repo | ||
- run: npm install | ||
- 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 | ||
- persist_to_workspace: | ||
root: ~/repo | ||
paths: . | ||
|
||
publish_docs: | ||
working_directory: ~/repo | ||
docker: | ||
- image: circleci/ruby:2.6.0-node | ||
environment: | ||
BUNDLE_PATH: ~/repo/vendor/bundle | ||
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: npm install | ||
- run: sudo npm install gitbook-cli -g | ||
- run: | ||
name: Do Magic | ||
command: sh ~/repo/build/update-docs.sh | ||
|
||
workflows: | ||
version: 2 | ||
|
||
### | ||
# PULL REQUESTS | ||
### | ||
test_build: | ||
jobs: | ||
- checkout_code: | ||
filters: | ||
branches: | ||
ignore: | ||
- master | ||
- feature/* | ||
- hotfix/* | ||
- test_and_report: | ||
requires: | ||
- checkout_code | ||
- build: | ||
requires: | ||
- checkout_code | ||
|
||
### | ||
# MERGE: MASTER | ||
### | ||
test_build_publish: | ||
jobs: | ||
- checkout_code: | ||
filters: | ||
branches: | ||
only: master | ||
- test_and_report: | ||
requires: | ||
- checkout_code | ||
- build: | ||
requires: | ||
- checkout_code | ||
- publish_npm: | ||
requires: | ||
- checkout_code | ||
- test_and_report | ||
- build | ||
# - build_examples: | ||
# requires: | ||
# - publish_npm | ||
- publish_docs: | ||
requires: | ||
- publish_npm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# reads version from package.json and sets prelease equal to Circle CI build number | ||
if [ $CI ] && [ $CIRCLE_BUILD_NUM ] | ||
then | ||
PACKAGE_VERSION=$(cat package.json \ | ||
| grep version \ | ||
| head -1 \ | ||
| awk -F: '{ print $2 }' \ | ||
| sed 's/[",]//g' \ | ||
| tr -d '[[:space:]]') | ||
|
||
NEW_PACKAGE_VERSION=$(echo $PACKAGE_VERSION | sed -e "s/^\([0-9]*\.[0-9]*\.[0-9]*\-[a-z]*\).[0-9]*$/\1.$CIRCLE_BUILD_NUM/") | ||
echo "Found package version: $PACKAGE_VERSION" | ||
echo "Setting version to: $NEW_PACKAGE_VERSION" | ||
# uses npm-version to set version in package.json | ||
# see https://docs.npmjs.com/cli/version | ||
npm version $NEW_PACKAGE_VERSION --no-git-tag-version | ||
# | ||
git config credential.helper 'cache --timeout=120' | ||
git config user.email "[email protected]" | ||
git config user.name "Daniel Brown" | ||
git add . | ||
git commit --allow-empty -m "Version Bump" | ||
# Push quietly to prevent showing the token in log | ||
# git push -q https://${GITHUB_TOKEN}@github.com/cornerstonejs/cornerstoneTools.git vNext | ||
else | ||
echo "Don't forget to update the build version!" | ||
fi |
This file was deleted.
Oops, something went wrong.