rsnext/.circleci/config.yml
JJ Kasper 7d0919a784 Break up basic test suite (#6730)
* Break out client-navigation and rendering
test from basic test

* Try with parallelism dialed back to 3

* Update jest-junit for more compatible timings in CircleCI

* Bump to test timings

* Use filepath for suitename in jest-junit

* Store reports as artifacts

* Try using classname for timings

* Bump

* Remove reports from artifacts
2019-03-20 11:01:32 +01:00

60 lines
1.9 KiB
YAML

version: 2
jobs:
build:
docker:
- image: circleci/node:8-browsers
working_directory: ~/repo
steps:
- checkout
- run:
name: Installing dependencies
command: yarn install --frozen-lockfile
- run:
name: Linting
command: yarn lint
- persist_to_workspace:
root: ~/repo
paths: ['.']
test:
parallelism: 3
docker:
- image: circleci/node:8-browsers
working_directory: ~/repo
steps:
- attach_workspace:
at: .
- run:
name: Tests
command: yarn testall $(circleci tests glob "test/**/*.test.*" | circleci tests split --split-by=timings --timings-type=classname)
environment:
JEST_JUNIT_OUTPUT: 'reports/junit/js-test-results.xml'
JEST_JUNIT_CLASSNAME: '{filepath}'
- store_test_results:
path: ~/repo/reports
deploy:
docker:
- image: circleci/node:8-browsers
working_directory: ~/repo
steps:
- attach_workspace:
at: .
- run:
name: Potentially save npm token
command: '([[ ! -z $NPM_TOKEN ]] && echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc) || echo "Did not write npm token"'
- run:
name: Potentially publish canary release
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'
- run:
name: Potentially publish stable release
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'
workflows:
version: 2
build-test-and-deploy:
jobs:
- build
- test:
requires:
- build
- deploy:
requires:
- test