2019-04-22 20:21:42 +02:00
|
|
|
version: 2.1
|
|
|
|
|
|
|
|
#########################
|
|
|
|
# Aliases
|
|
|
|
#########################
|
|
|
|
|
|
|
|
aliases:
|
|
|
|
- &store_test_results
|
|
|
|
store_test_results:
|
2019-11-25 23:50:46 +01:00
|
|
|
path: ~/repo/test
|
2019-04-22 20:21:42 +02:00
|
|
|
- &persist_to_workspace
|
|
|
|
persist_to_workspace:
|
|
|
|
root: ~/repo
|
|
|
|
paths: ['.']
|
|
|
|
- &attach_workspace
|
|
|
|
attach_workspace:
|
|
|
|
at: .
|
|
|
|
|
|
|
|
#########################
|
|
|
|
# Executors
|
|
|
|
#########################
|
|
|
|
|
|
|
|
executors:
|
|
|
|
node:
|
2018-09-02 15:14:29 +02:00
|
|
|
docker:
|
2019-09-11 18:56:32 +02:00
|
|
|
- image: circleci/node@sha256:8631b3dc0f49fc179940bbd4254ced0c41b99d02bfdbf1d8bdd4d0b135e3ee5f
|
2018-09-02 15:14:29 +02:00
|
|
|
working_directory: ~/repo
|
2019-04-22 20:21:42 +02:00
|
|
|
|
|
|
|
#########################
|
|
|
|
# Commands
|
|
|
|
#########################
|
|
|
|
|
|
|
|
commands:
|
|
|
|
yarn_install:
|
2018-09-02 15:14:29 +02:00
|
|
|
steps:
|
2018-10-02 14:49:39 +02:00
|
|
|
- run:
|
2019-04-22 20:21:42 +02:00
|
|
|
name: Installing Dependencies
|
2019-10-23 20:14:32 +02:00
|
|
|
command: yarn install --frozen-lockfile --check-files
|
2019-10-26 19:27:22 +02:00
|
|
|
- run:
|
|
|
|
name: Install correct Chrome Driver version
|
2019-11-25 19:19:45 +01:00
|
|
|
command: node node_modules/chromedriver/install.js
|
|
|
|
environment:
|
|
|
|
CHROMEDRIVER_VERSION: '76.0.3809.68'
|
2019-10-26 19:27:22 +02:00
|
|
|
- run: google-chrome --version
|
2019-11-25 19:19:45 +01:00
|
|
|
- run: yarn chromedriver --version
|
2019-04-22 20:21:42 +02:00
|
|
|
yarn_lint:
|
|
|
|
steps:
|
2019-02-11 08:15:23 +01:00
|
|
|
- run:
|
|
|
|
name: Linting
|
|
|
|
command: yarn lint
|
2019-10-22 20:44:24 +02:00
|
|
|
yarn_react_integration:
|
2019-10-21 21:02:34 +02:00
|
|
|
steps:
|
|
|
|
- run:
|
2019-10-22 20:44:24 +02:00
|
|
|
name: Upgrade to most recent release in React's Next channel
|
|
|
|
command: yarn upgrade react@next react-dom@next -W --dev # upgrade (vs add) will skip re-building Next.js, which doesn't bundle React internals (so this is OK!)
|
2019-12-05 17:17:26 +01:00
|
|
|
environment:
|
|
|
|
CHROMEDRIVER_VERSION: '76.0.3809.68'
|
2019-10-21 21:02:34 +02:00
|
|
|
yarn_info:
|
|
|
|
steps:
|
|
|
|
- run:
|
|
|
|
name: React Versions
|
|
|
|
command: yarn why react && yarn why react-dom
|
2019-04-22 20:21:42 +02:00
|
|
|
test_all:
|
2019-03-20 02:55:43 +01:00
|
|
|
steps:
|
2019-02-11 08:15:23 +01:00
|
|
|
- run:
|
2019-04-22 20:21:42 +02:00
|
|
|
name: Run All Tests
|
2019-07-15 16:04:36 +02:00
|
|
|
command: |
|
2019-11-27 20:49:17 +01:00
|
|
|
node run-tests.js --timings -c 3 $(
|
2019-07-15 16:04:36 +02:00
|
|
|
circleci tests glob "test/**/*.test.*" | \
|
2019-11-25 23:50:46 +01:00
|
|
|
circleci tests split --split-by=timings
|
2019-07-15 16:04:36 +02:00
|
|
|
)
|
2019-09-13 04:51:56 +02:00
|
|
|
environment:
|
|
|
|
NEXT_TELEMETRY_DISABLED: '1'
|
2019-07-15 16:04:36 +02:00
|
|
|
test_browser:
|
|
|
|
parameters:
|
|
|
|
browser:
|
|
|
|
type: string
|
2019-03-29 16:05:53 +01:00
|
|
|
steps:
|
|
|
|
- run:
|
2019-07-15 16:04:36 +02:00
|
|
|
name: Test in a browser
|
|
|
|
command: |
|
|
|
|
if [[ ! -z $BROWSERSTACK_USERNAME ]]; then
|
|
|
|
yarn testall test/integration/production/
|
|
|
|
else
|
|
|
|
echo "Not running for PR"
|
|
|
|
fi
|
2019-03-29 16:17:47 +01:00
|
|
|
environment:
|
|
|
|
BROWSERSTACK: 'true'
|
2019-07-15 16:04:36 +02:00
|
|
|
BROWSER_NAME: << parameters.browser >>
|
2019-09-13 04:51:56 +02:00
|
|
|
NEXT_TELEMETRY_DISABLED: '1'
|
2019-04-22 20:21:42 +02:00
|
|
|
save_npm_token:
|
2019-03-20 02:55:43 +01:00
|
|
|
steps:
|
2019-02-11 08:15:23 +01:00
|
|
|
- run:
|
|
|
|
name: Potentially save npm token
|
2019-07-15 16:04:36 +02:00
|
|
|
command: |
|
|
|
|
([[ ! -z $NPM_TOKEN ]] && echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc) || echo "Did not write npm token"
|
2019-04-22 20:21:42 +02:00
|
|
|
publish_canary:
|
|
|
|
steps:
|
2018-10-02 14:49:39 +02:00
|
|
|
- run:
|
2019-02-11 08:15:23 +01:00
|
|
|
name: Potentially publish canary release
|
2019-07-15 16:04:36 +02: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
|
2019-04-22 20:21:42 +02:00
|
|
|
publish_stable:
|
|
|
|
steps:
|
2018-10-02 14:49:39 +02:00
|
|
|
- run:
|
2019-02-11 08:15:23 +01:00
|
|
|
name: Potentially publish stable release
|
2019-07-15 16:04:36 +02: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
|
2019-04-22 20:21:42 +02:00
|
|
|
|
|
|
|
#########################
|
|
|
|
# Jobs
|
|
|
|
#########################
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
executor: node
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- yarn_install
|
|
|
|
- *persist_to_workspace
|
2019-10-21 21:02:34 +02:00
|
|
|
build-react-canary:
|
|
|
|
executor: node
|
|
|
|
steps:
|
|
|
|
- *attach_workspace
|
2019-10-22 20:44:24 +02:00
|
|
|
- yarn_react_integration
|
2019-10-21 21:02:34 +02:00
|
|
|
- *persist_to_workspace
|
2019-11-27 20:57:18 +01:00
|
|
|
lint:
|
|
|
|
executor: node
|
|
|
|
steps:
|
|
|
|
- *attach_workspace
|
|
|
|
- yarn_lint
|
2019-04-22 20:21:42 +02:00
|
|
|
test:
|
2019-11-27 20:49:17 +01:00
|
|
|
parallelism: 6
|
2019-04-22 20:21:42 +02:00
|
|
|
executor: node
|
|
|
|
steps:
|
|
|
|
- *attach_workspace
|
2019-10-21 21:02:34 +02:00
|
|
|
- yarn_info
|
2019-04-22 20:21:42 +02:00
|
|
|
- test_all
|
|
|
|
- *store_test_results
|
|
|
|
test-ie11:
|
|
|
|
executor: node
|
|
|
|
steps:
|
|
|
|
- *attach_workspace
|
2019-07-15 16:04:36 +02:00
|
|
|
- test_browser:
|
|
|
|
browser: 'ie'
|
2019-04-22 20:21:42 +02:00
|
|
|
test-safari:
|
|
|
|
executor: node
|
|
|
|
steps:
|
|
|
|
- *attach_workspace
|
2019-07-15 16:04:36 +02:00
|
|
|
- test_browser:
|
|
|
|
browser: 'safari'
|
2019-04-22 20:21:42 +02:00
|
|
|
test-firefox:
|
|
|
|
executor: node
|
|
|
|
steps:
|
|
|
|
- *attach_workspace
|
2019-07-15 16:04:36 +02:00
|
|
|
- test_browser:
|
|
|
|
browser: 'firefox'
|
2019-04-22 20:21:42 +02:00
|
|
|
deploy:
|
|
|
|
executor: node
|
|
|
|
steps:
|
|
|
|
- *attach_workspace
|
|
|
|
- save_npm_token
|
|
|
|
- publish_canary
|
|
|
|
- publish_stable
|
|
|
|
|
|
|
|
#########################
|
|
|
|
# Workflows
|
|
|
|
#########################
|
|
|
|
|
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-11-27 20:57:18 +01:00
|
|
|
- lint:
|
|
|
|
requires:
|
|
|
|
- build
|
2019-04-04 23:47:17 +02:00
|
|
|
- test-ie11:
|
2019-03-29 16:05:53 +01:00
|
|
|
requires:
|
|
|
|
- build
|
2019-04-09 16:43:00 +02:00
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
only:
|
|
|
|
- master
|
|
|
|
- canary
|
2019-04-09 23:58:44 +02:00
|
|
|
- test-safari:
|
|
|
|
requires:
|
|
|
|
- build
|
|
|
|
- test
|
|
|
|
- test-ie11
|
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
only:
|
|
|
|
- master
|
|
|
|
- canary
|
|
|
|
- test-firefox:
|
|
|
|
requires:
|
|
|
|
- build
|
|
|
|
- test
|
|
|
|
- test-ie11
|
|
|
|
- test-safari
|
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
only:
|
|
|
|
- master
|
|
|
|
- canary
|
2019-03-20 02:55:43 +01:00
|
|
|
- deploy:
|
|
|
|
requires:
|
2019-08-01 13:26:31 +02:00
|
|
|
- test
|
2019-04-09 16:43:00 +02:00
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
only:
|
|
|
|
- master
|
|
|
|
- canary
|
2019-10-21 21:02:34 +02:00
|
|
|
q12h-react-canary:
|
|
|
|
triggers:
|
|
|
|
- schedule:
|
|
|
|
cron: '0 0,12 * * *'
|
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
only:
|
|
|
|
- canary
|
|
|
|
jobs:
|
|
|
|
- build
|
|
|
|
- build-react-canary:
|
|
|
|
requires:
|
|
|
|
- build
|
|
|
|
- test:
|
|
|
|
requires:
|
|
|
|
- build-react-canary
|