storybook/.circleci/config.yml

259 lines
6.6 KiB
YAML

defaults: &defaults
working_directory: /tmp/storybook
docker:
- image: node:8
environment:
BASH_ENV: ~/.bashrc
version: 2
dependencies:
pre:
- yarn global add npm
jobs:
build:
<<: *defaults
steps:
- checkout
- restore_cache:
keys:
- dependencies-{{ checksum "yarn.lock" }}
- dependencies-
- run:
name: "Install latest yarn version"
command: |
curl -o- -L https://yarnpkg.com/install.sh | bash -s
- 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 latest yarn version"
command: |
curl -o- -L https://yarnpkg.com/install.sh | bash -s
- 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
- run:
name: "Build angular kitchen-sink"
command: |
cd examples/angular-cli
yarn build-storybook
yarn storybook --smoke-test
example-react-native:
<<: *defaults
steps:
- checkout
- restore_cache:
keys:
- dependencies-{{ checksum "yarn.lock" }}
- dependencies-
- run:
name: "Install latest yarn version"
command: |
curl -o- -L https://yarnpkg.com/install.sh | bash -s
- 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 latest yarn version"
command: |
curl -o- -L https://yarnpkg.com/install.sh | bash -s
- 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 latest yarn version"
command: |
curl -o- -L https://yarnpkg.com/install.sh | bash -s
- run:
name: "Install dependencies"
command: |
yarn install
- run:
name: "Linting"
command: |
yarn lint
unit-test:
<<: *defaults
steps:
- checkout
- restore_cache:
keys:
- dependencies-{{ checksum "yarn.lock" }}
- dependencies-
- run:
name: "Install latest yarn version"
command: |
curl -o- -L https://yarnpkg.com/install.sh | bash -s
- run:
name: "Install dependencies"
command: |
yarn install
- run:
name: "Bootstrapping"
command: |
yarn bootstrap --core --reactnative
- run:
name: "Unit testing"
command: |
yarn test --all --coverage --runInBand
yarn coverage
cli:
working_directory: /tmp/storybook
docker:
- image: andthensome/docker-node-rsync
environment:
BASH_ENV: ~/.bashrc
steps:
- checkout
- restore_cache:
keys:
- dependencies-{{ checksum "yarn.lock" }}
- dependencies-
- run:
name: "Install latest yarn version"
command: |
curl -o- -L https://yarnpkg.com/install.sh | bash -s
- run:
name: "Install dependencies"
command: |
yarn install
- run:
name: "Bootstrapping"
command: |
yarn bootstrap --core
- run:
name: "Testing CLI"
command: |
yarn test --cli
cli-latest-cra:
working_directory: /tmp/storybook
docker:
- image: andthensome/docker-node-rsync
environment:
BASH_ENV: ~/.bashrc
steps:
- checkout
- restore_cache:
keys:
- dependencies-{{ checksum "yarn.lock" }}
- dependencies-
- run:
name: "Install latest yarn version"
command: |
curl -o- -L https://yarnpkg.com/install.sh | bash -s
- run:
name: "Install dependencies"
command: |
yarn install
- run:
name: "Bootstrapping"
command: |
yarn bootstrap --core
- run:
name: "Testing CLI with latest CR(N)A"
command: |
yarn test-latest-cra
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
- cli
- cli-latest-cra
# - deploy:
# type: approval
# requires:
# - lint
# - unit-test
# - docs