Skip to content

Commit

Permalink
fix: test ci semantic-release
Browse files Browse the repository at this point in the history
* feat(SemanticRelease): Inclues semantic-release, commitizen and husky configuration

re #267

* feat(CircleCI): Include configuration to run the application in Circle CI

Include configuration to run the application in Circle CI

re #267

* remove yarn lock

* ci: nuke travis

* ci: clean up config to match project setup

* clean up npm scripts

* ci: better workflow names

* ci: syntax

* add missing steps key

* package lock to make the ci fairy happy

* ci: make sure chrome is available to run tests
  • Loading branch information
dannyrb committed Sep 12, 2019
1 parent ebc90fa commit b599d3d
Show file tree
Hide file tree
Showing 3 changed files with 7,773 additions and 1,302 deletions.
83 changes: 42 additions & 41 deletions packages/dicomImageLoader/.circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,57 +1,52 @@
# Use the latest 2.1 version of CircleCI pipeline processing engine, see https://circleci.com/docs/2.0/configuration-reference/
version: 2.1

### ABOUT
#
# This configuration powers our Circleci.io integration
#
###

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

jobs:
build_and_test:
CHECKOUT:
<<: *defaults
steps:
# Download and cache dependencies
- checkout
- restore_cache:
name: Restore Yarn Package Cache
name: Restore Package Cache
keys:
# when lock file changes, use increasingly general patterns to restore cache
- yarn-packages-v1-{{ .Branch }}-{{ checksum "yarn.lock" }}
- yarn-packages-v1-{{ .Branch }}-
- yarn-packages-v1-
- run:
name: Install Dependencies
command: yarn install --frozen-lockfile
- packages-v1-{{ .Branch }}-{{ checksum "package.json" }}
- packages-v1-{{ .Branch }}-
- packages-v1-
- run: npm ci
- save_cache:
name: Save Yarn Package Cache
name: Save Package Cache
paths:
- ~/.cache/yarn
key: yarn-packages-v1-{{ .Branch }}-{{ checksum "yarn.lock" }}

# Build & Test
- run: yarn run build:ci
- run:
name: "JavaScript Test Suite"
command: yarn test

# Store result
- store_test_results:
path: reports/junit
- store_artifacts:
path: reports/junit
- ~/repo/node_modules
key: packages-v1-{{ .Branch }}-{{ checksum "package.json" }}
- persist_to_workspace:
root: ~/repo
paths: .

# Persist :+1:
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:
NPM_PUBLISH:
<<: *defaults
steps:
- attach_workspace:
Expand All @@ -68,24 +63,30 @@ jobs:
workflows:
version: 2

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

# MERGE TO MASTER
cut_release:
TEST_AND_RELEASE:
jobs:
- build_and_test:
- CHECKOUT:
filters:
branches:
only: master
- npm_publish:
- BUILD_AND_TEST:
requires:
- CHECKOUT
- NPM_PUBLISH:
requires:
- build_and_test
- BUILD_AND_TEST
Loading

0 comments on commit b599d3d

Please sign in to comment.