Skip to content

Commit

Permalink
Merge pull request #3016 from storybooks/optimize-ci
Browse files Browse the repository at this point in the history
Optimize CI workflow
  • Loading branch information
danielduan authored Feb 20, 2018
2 parents 3ad0ef8 + 4eeb9cd commit 9250e98
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 30 deletions.
68 changes: 38 additions & 30 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,11 @@ jobs:
key: core-dependencies-{{ checksum "yarn.lock" }}
paths:
- node_modules
- example/cra-kitchen-sink/node_modules
- example/vue-kitchen-sink/node_modules
- examples/angular-cli/node_modules
- examples/cra-kitchen-sink/node_modules
- examples/official-storybook/node_modules
- examples/polymer-cli/node_modules
- examples/vue-kitchen-sink/node_modules
- save_cache:
name: "Cache core dist"
key: core-dist-{{ .Revision }}
Expand All @@ -54,10 +57,6 @@ jobs:
name: "Restore core dist cache"
keys:
- core-dist-{{ .Revision }}
- run:
name: "Link packages"
command: |
yarn install
- run:
name: Workaround for https://github.com/GoogleChrome/puppeteer/issues/290
command: sh ./scripts/workaround-puppeteer-issue-290.sh
Expand Down Expand Up @@ -86,6 +85,35 @@ jobs:
command: |
cd examples/official-storybook
yarn build-storybook
- run:
name: "Visually test storybook"
command: |
yarn chromatic
- run:
name: "Run image snapshots"
command: yarn test --image
- run:
name: Integration Test - Kichen sinks
command: yarn test --integration
- store_artifacts:
path: integration/__image_snapshots__
destination: integration_image_snapshots
- store_artifacts:
path: examples/official-storybook/image-snapshots/__image_snapshots__
destination: official_storybook_image_snapshots
smoke-tests:
<<: *defaults
steps:
- checkout
- restore_cache:
name: "Restore core dependencies cache"
keys:
- core-dependencies-{{ checksum "yarn.lock" }}
- restore_cache:
name: "Restore core dist cache"
keys:
- core-dist-{{ .Revision }}

- run:
name: "Run react kitchen-sink (smoke test)"
command: |
Expand All @@ -111,22 +139,6 @@ jobs:
command: |
cd examples/official-storybook
yarn storybook --smoke-test
- run:
name: "Visually test storybook"
command: |
yarn chromatic
- run:
name: "Run image snapshots"
command: yarn test --image
- run:
name: Integration Test - Kichen sinks
command: yarn test --integration
- store_artifacts:
path: integration/__image_snapshots__
destination: integration_image_snapshots
- store_artifacts:
path: examples/official-storybook/image-snapshots/__image_snapshots__
destination: official_storybook_image_snapshots
react-native:
<<: *defaults
steps:
Expand Down Expand Up @@ -197,10 +209,6 @@ jobs:
name: "Restore core dist cache"
keys:
- core-dist-{{ .Revision }}
- run:
name: "Link packages"
command: |
yarn install
- run:
name: "Lint"
command: |
Expand All @@ -217,10 +225,6 @@ jobs:
name: "Restore core dist cache"
keys:
- core-dist-{{ .Revision }}
- run:
name: "Link packages"
command: |
yarn install
- run:
name: "Run unit tests"
command: |
Expand Down Expand Up @@ -281,12 +285,16 @@ workflows:
- example-kitchen-sinks:
requires:
- build
- smoke-tests:
requires:
- build
- react-native:
requires:
- build
- docs
- lint:
requires:
- docs
- build
- unit-test:
requires:
Expand Down
2 changes: 2 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -16961,3 +16961,5 @@ yn@^2.0.0:
zone.js@^0.8.20:
version "0.8.20"
resolved "https://registry.yarnpkg.com/zone.js/-/zone.js-0.8.20.tgz#a218c48db09464b19ff6fc8f0d4bb5b1046e185d"


0 comments on commit 9250e98

Please sign in to comment.