2018-09-02 15:14:29 +02:00
|
|
|
version: 2
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
docker:
|
|
|
|
- image: circleci/node:8-browsers
|
|
|
|
working_directory: ~/repo
|
|
|
|
steps:
|
|
|
|
- checkout
|
2018-10-02 14:49:39 +02:00
|
|
|
- run:
|
2019-02-11 08:15:23 +01:00
|
|
|
name: Installing dependencies
|
2019-02-20 06:17:14 +01:00
|
|
|
command: yarn install --frozen-lockfile
|
2019-02-11 08:15:23 +01:00
|
|
|
- run:
|
|
|
|
name: Linting
|
|
|
|
command: yarn lint
|
2019-03-20 02:55:43 +01:00
|
|
|
- persist_to_workspace:
|
|
|
|
root: ~/repo
|
|
|
|
paths: ['.']
|
|
|
|
test:
|
2019-03-20 11:01:32 +01:00
|
|
|
parallelism: 3
|
2019-03-20 02:55:43 +01:00
|
|
|
docker:
|
|
|
|
- image: circleci/node:8-browsers
|
|
|
|
working_directory: ~/repo
|
|
|
|
steps:
|
|
|
|
- attach_workspace:
|
|
|
|
at: .
|
2019-02-11 08:15:23 +01:00
|
|
|
- run:
|
|
|
|
name: Tests
|
2019-03-20 11:01:32 +01:00
|
|
|
command: yarn testall $(circleci tests glob "test/**/*.test.*" | circleci tests split --split-by=timings --timings-type=classname)
|
2019-03-20 02:55:43 +01:00
|
|
|
environment:
|
|
|
|
JEST_JUNIT_OUTPUT: 'reports/junit/js-test-results.xml'
|
2019-03-20 11:01:32 +01:00
|
|
|
JEST_JUNIT_CLASSNAME: '{filepath}'
|
2019-03-20 02:55:43 +01:00
|
|
|
- store_test_results:
|
|
|
|
path: ~/repo/reports
|
2019-03-29 16:05:53 +01:00
|
|
|
test-production:
|
|
|
|
docker:
|
|
|
|
- image: circleci/node:8-browsers
|
|
|
|
working_directory: ~/repo
|
|
|
|
steps:
|
|
|
|
- attach_workspace:
|
|
|
|
at: .
|
|
|
|
- run:
|
|
|
|
name: Production Tests
|
|
|
|
command: '[[ ! -z $BROWSERSTACK_USERNAME ]] && yarn testall test/integration/production/ || echo "Not running for PR"'
|
2019-03-29 16:17:47 +01:00
|
|
|
environment:
|
|
|
|
BROWSERSTACK: 'true'
|
|
|
|
BROWSER_NAME: 'ie'
|
2019-03-20 02:55:43 +01:00
|
|
|
deploy:
|
|
|
|
docker:
|
|
|
|
- image: circleci/node:8-browsers
|
|
|
|
working_directory: ~/repo
|
|
|
|
steps:
|
|
|
|
- attach_workspace:
|
|
|
|
at: .
|
2019-02-11 08:15:23 +01:00
|
|
|
- run:
|
|
|
|
name: Potentially save npm token
|
2019-03-20 02:55:43 +01:00
|
|
|
command: '([[ ! -z $NPM_TOKEN ]] && echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc) || echo "Did not write npm token"'
|
2018-10-02 14:49:39 +02:00
|
|
|
- run:
|
2019-02-11 08:15:23 +01:00
|
|
|
name: Potentially publish canary release
|
2019-03-20 02:55:43 +01:00
|
|
|
command: 'if ls ~/.npmrc >/dev/null 2>&1 && [[ $(git describe --exact-match 2> /dev/null || :) =~ -canary ]]; then yarn run lerna publish from-git --npm-tag canary --yes; else echo "Did not publish"; fi'
|
2018-10-02 14:49:39 +02:00
|
|
|
- run:
|
2019-02-11 08:15:23 +01:00
|
|
|
name: Potentially publish stable release
|
2019-03-20 02:55:43 +01:00
|
|
|
command: 'if ls ~/.npmrc >/dev/null 2>&1 && [[ ! $(git describe --exact-match 2> /dev/null || :) =~ -canary ]]; then yarn run lerna publish from-git --yes; else echo "Did not publish"; fi'
|
2018-10-02 14:49:39 +02:00
|
|
|
workflows:
|
|
|
|
version: 2
|
2019-03-20 02:55:43 +01:00
|
|
|
build-test-and-deploy:
|
2018-10-02 14:49:39 +02:00
|
|
|
jobs:
|
2019-02-14 14:33:00 +01:00
|
|
|
- build
|
2019-03-20 02:55:43 +01:00
|
|
|
- test:
|
|
|
|
requires:
|
|
|
|
- build
|
2019-03-29 16:05:53 +01:00
|
|
|
- test-production:
|
|
|
|
requires:
|
|
|
|
- build
|
2019-03-20 02:55:43 +01:00
|
|
|
- deploy:
|
|
|
|
requires:
|
|
|
|
- test
|