mirror of
https://github.com/storybookjs/storybook.git
synced 2025-03-28 05:10:17 +08:00
173 lines
4.1 KiB
YAML
173 lines
4.1 KiB
YAML
defaults: &defaults
|
|
working_directory: /tmp/storybook
|
|
docker:
|
|
- image: node:8
|
|
|
|
version: 2
|
|
dependencies:
|
|
pre:
|
|
- yarn global add npm
|
|
jobs:
|
|
build:
|
|
<<: *defaults
|
|
steps:
|
|
- checkout
|
|
- restore_cache:
|
|
keys:
|
|
- dependencies-{{ checksum "yarn.lock" }}
|
|
- dependencies-
|
|
- run:
|
|
name: "Install dependencies"
|
|
command: |
|
|
yarn install
|
|
- run:
|
|
name: "Bootstrapping"
|
|
command: |
|
|
yarn bootstrap --core --docs --reactnative --reactnativeapp
|
|
- save_cache:
|
|
key: dependencies-{{ checksum "yarn.lock" }}
|
|
paths:
|
|
- node_modules
|
|
- app/**/node_modules
|
|
- docs/**/node_modules
|
|
- examples/**/node_modules
|
|
- lib/**/node_modules
|
|
example-kitchen-sinks:
|
|
<<: *defaults
|
|
steps:
|
|
- checkout
|
|
- restore_cache:
|
|
keys:
|
|
- dependencies-{{ checksum "yarn.lock" }}
|
|
- dependencies-
|
|
- run:
|
|
name: "Install dependencies"
|
|
command: |
|
|
yarn install
|
|
- run:
|
|
name: "Bootstrapping"
|
|
command: |
|
|
yarn bootstrap --core
|
|
- run:
|
|
name: "Build react kitchen-sink"
|
|
command: |
|
|
cd examples/cra-kitchen-sink
|
|
yarn build-storybook
|
|
yarn storybook --smoke-test
|
|
- run:
|
|
name: "Build vue kitchen-sink"
|
|
command: |
|
|
cd examples/vue-kitchen-sink
|
|
yarn build-storybook
|
|
yarn storybook --smoke-test
|
|
example-react-native:
|
|
<<: *defaults
|
|
steps:
|
|
- checkout
|
|
- restore_cache:
|
|
keys:
|
|
- dependencies-{{ checksum "yarn.lock" }}
|
|
- dependencies-
|
|
- run:
|
|
name: "Install dependencies"
|
|
command: |
|
|
yarn install
|
|
- run:
|
|
name: "Bootstrapping packages"
|
|
command: |
|
|
yarn bootstrap --core --reactnative --reactnativeapp
|
|
- run:
|
|
name: "Running React-Native example"
|
|
command: |
|
|
cd examples/react-native-vanilla
|
|
yarn storybook --smoke-test
|
|
- run:
|
|
name: "Running React-Native-App example"
|
|
command: |
|
|
cd examples/crna-kitchen-sink
|
|
yarn storybook --smoke-test
|
|
docs:
|
|
<<: *defaults
|
|
steps:
|
|
- checkout
|
|
- restore_cache:
|
|
keys:
|
|
- dependencies-{{ checksum "yarn.lock" }}
|
|
- dependencies-
|
|
- run:
|
|
name: "Install dependencies"
|
|
command: |
|
|
yarn install
|
|
- run:
|
|
name: "Bootstrapping"
|
|
command: |
|
|
yarn bootstrap --docs
|
|
- run:
|
|
name: "Running docs"
|
|
command: |
|
|
yarn docs:build
|
|
lint:
|
|
<<: *defaults
|
|
steps:
|
|
- checkout
|
|
- restore_cache:
|
|
keys:
|
|
- dependencies-{{ checksum "yarn.lock" }}
|
|
- dependencies-
|
|
- run:
|
|
name: "Install dependencies"
|
|
command: |
|
|
yarn install
|
|
- run:
|
|
name: "Bootstrapping"
|
|
command: |
|
|
yarn bootstrap --core --docs
|
|
- run:
|
|
name: "Linting"
|
|
command: |
|
|
yarn lint
|
|
unit-test:
|
|
<<: *defaults
|
|
steps:
|
|
- checkout
|
|
- restore_cache:
|
|
keys:
|
|
- dependencies-{{ checksum "yarn.lock" }}
|
|
- dependencies-
|
|
- run:
|
|
name: "Install dependencies"
|
|
command: |
|
|
yarn install
|
|
- run:
|
|
name: "Bootstrapping"
|
|
command: |
|
|
yarn bootstrap --core --reactnative
|
|
- run:
|
|
name: "Unit testing"
|
|
command: |
|
|
yarn test --coverage -i
|
|
yarn coverage
|
|
deploy:
|
|
<<: *defaults
|
|
steps:
|
|
- run:
|
|
name: "Deploy"
|
|
command: |
|
|
echo "TODO"
|
|
workflows:
|
|
version: 2
|
|
build_accept_deploy:
|
|
jobs:
|
|
- build
|
|
- example-kitchen-sinks
|
|
- example-react-native
|
|
- docs
|
|
- lint
|
|
- unit-test
|
|
# - deploy:
|
|
# type: approval
|
|
# requires:
|
|
# - lint
|
|
# - unit-test
|
|
# - docs
|