diff --git a/.circleci/config.yml b/.circleci/config.yml index 17e93ac916a9..4f20c8944f73 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -13,42 +13,51 @@ jobs: steps: - checkout - restore_cache: + name: "Restore core dependencies cache" keys: - - dependencies-{{ checksum "yarn.lock" }} + - core-dependencies-{{ checksum "yarn.lock" }} - run: name: "Install dependencies" command: | yarn install - run: - name: "Bootstrapping" + name: "Dirty check" command: | - yarn bootstrap --core --docs --reactnative --reactnativeapp + yarn repo-dirty-check - run: - name: "Dirty checking" + name: "Bootstrap" command: | - yarn repo-dirty-check + yarn bootstrap --core - save_cache: - key: dependencies-{{ checksum "yarn.lock" }} + name: "Cache core dependencies" + key: core-dependencies-{{ checksum "yarn.lock" }} paths: - node_modules - - docs/node_modules - - examples/react-native-vanilla/node_modules - - examples/crna-kitchen-sink/node_modules + - example/cra-kitchen-sink/node_modules + - example/vue-kitchen-sink/node_modules + - save_cache: + name: "Cache core dist" + key: core-dist-{{ .Revision }} + paths: + - addons + - app + - lib example-kitchen-sinks: <<: *defaults steps: - checkout - restore_cache: + name: "Restore core dependencies cache" keys: - - dependencies-{{ checksum "yarn.lock" }} + - core-dependencies-{{ checksum "yarn.lock" }} + - restore_cache: + name: "Restore core dist cache" + keys: + - core-dist-{{ .Revision }} - run: - name: "Install dependencies" + name: "Link packages" command: | yarn install - - run: - name: "Bootstrapping" - command: | - yarn bootstrap --core - run: name: "Build react kitchen-sink" command: | @@ -60,15 +69,15 @@ jobs: cd examples/vue-kitchen-sink yarn build-storybook - run: - name: "Run vue kitchen-sink" + name: "Run react kitchen-sink" command: | - cd examples/vue-kitchen-sink + cd examples/cra-kitchen-sink yarn storybook background: true - run: - name: "Run react kitchen-sink" + name: "Run vue kitchen-sink" command: | - cd examples/cra-kitchen-sink + cd examples/vue-kitchen-sink yarn storybook background: true - run: @@ -80,67 +89,92 @@ jobs: - store_artifacts: path: integration/__image_snapshots__ destination: integration_image_snapshots - example-react-native: + react-native: <<: *defaults steps: - checkout - restore_cache: + name: "Restore core dependencies cache" keys: - - dependencies-{{ checksum "yarn.lock" }} - - run: - name: "Install dependencies" - command: | - yarn install + - core-dependencies-{{ checksum "yarn.lock" }} + - restore_cache: + name: "Restore core dist cache" + keys: + - core-dist-{{ .Revision }} - run: - name: "Bootstrapping packages" + name: "Bootstrap" command: | - yarn bootstrap --core --reactnative --reactnativeapp + yarn bootstrap --reactnative --reactnativeapp - run: - name: "Running React-Native example" + name: "Run React-Native example" command: | cd examples/react-native-vanilla yarn storybook --smoke-test - run: - name: "Running React-Native-App example" + name: "Run React-Native-App example" command: | cd examples/crna-kitchen-sink yarn storybook --smoke-test + - run: + name: "Run React-Native unit tests" + command: | + yarn test --coverage --runInBand --reactnative + yarn coverage docs: <<: *defaults steps: - checkout - restore_cache: + name: "Restore core dependencies cache" keys: - - dependencies-{{ checksum "yarn.lock" }} + - core-dependencies-{{ checksum "yarn.lock" }} + - restore_cache: + name: "Restore docs dependencies cache" + keys: + - docs-dependencies-{{ checksum "docs/yarn.lock" }} - run: - name: "Install dependencies" + name: "Install core dependencies" command: | yarn install - run: - name: "Bootstrapping" + name: "Install dependencies" command: | yarn bootstrap --docs - run: - name: "Running docs" + name: "Dirty check" + command: | + yarn repo-dirty-check + - run: + name: "Run docs" command: | yarn docs:build + - save_cache: + name: "Cache dependencies" + key: docs-dependencies-{{ checksum "docs/yarn.lock" }} + paths: + - docs/node_modules lint: <<: *defaults steps: - checkout - restore_cache: + name: "Restore core dependencies cache" keys: - - dependencies-{{ checksum "yarn.lock" }} + - core-dependencies-{{ checksum "yarn.lock" }} + - restore_cache: + name: "Restore docs dependencies cache" + keys: + - docs-dependencies-{{ checksum "docs/yarn.lock" }} + - restore_cache: + name: "Restore core dist cache" + keys: + - core-dist-{{ .Revision }} - run: - name: "Install dependencies" + name: "Link packages" command: | yarn install - run: - name: "Bootstrapping" - command: | - yarn bootstrap --core --docs - - run: - name: "Linting" + name: "Lint" command: | yarn lint unit-test: @@ -148,20 +182,21 @@ jobs: steps: - checkout - restore_cache: + name: "Restore core dependencies cache" + keys: + - core-dependencies-{{ checksum "yarn.lock" }} + - restore_cache: + name: "Restore core dist cache" keys: - - dependencies-{{ checksum "yarn.lock" }} + - core-dist-{{ .Revision }} - run: - name: "Install dependencies" + name: "Link packages" command: | yarn install - run: - name: "Bootstrapping" - command: | - yarn bootstrap --core --reactnative - - run: - name: "Unit testing" + name: "Run unit tests" command: | - yarn test --coverage --runInBand --core --reactnative + yarn test --coverage --runInBand --core yarn coverage deploy: <<: *defaults @@ -175,8 +210,16 @@ workflows: build_accept_deploy: jobs: - build - - example-kitchen-sinks - - example-react-native + - example-kitchen-sinks: + requires: + - build + - react-native: + requires: + - build - docs - - lint - - unit-test + - lint: + requires: + - build + - unit-test: + requires: + - build