2019-01-07 07:55:57 +00:00
|
|
|
version: 2.1
|
|
|
|
|
|
|
|
docker_defaults: &docker_defaults
|
|
|
|
docker:
|
2022-09-07 08:19:41 +00:00
|
|
|
- image: cimg/node:16.17.0
|
2019-01-07 07:55:57 +00:00
|
|
|
|
|
|
|
commands:
|
|
|
|
prep_env:
|
|
|
|
description: Prepares environment with cache
|
|
|
|
steps:
|
|
|
|
- checkout:
|
|
|
|
path: ~/repo
|
|
|
|
- restore_cache:
|
|
|
|
name: Restore node_modules cache
|
2020-01-03 22:22:24 +00:00
|
|
|
key:
|
|
|
|
all-contributors-cli-v2-{{ checksum "package.json" }}-{{ .Branch }}
|
2019-01-07 07:55:57 +00:00
|
|
|
save_env_cache:
|
|
|
|
description: Saves environment cache
|
|
|
|
steps:
|
|
|
|
- save_cache:
|
|
|
|
name: Save node_modules cache
|
2020-01-03 22:22:24 +00:00
|
|
|
key:
|
|
|
|
all-contributors-cli-v2-{{ checksum "package.json" }}-{{ .Branch }}
|
2019-01-07 07:55:57 +00:00
|
|
|
paths:
|
|
|
|
- node_modules/
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
node_modules:
|
|
|
|
<<: *docker_defaults
|
|
|
|
working_directory: ~/repo
|
|
|
|
steps:
|
|
|
|
- prep_env
|
|
|
|
- run: yarn install
|
|
|
|
- save_env_cache
|
|
|
|
validate:
|
|
|
|
<<: *docker_defaults
|
|
|
|
working_directory: ~/repo
|
|
|
|
steps:
|
|
|
|
- prep_env
|
|
|
|
- run: yarn validate
|
|
|
|
- persist_to_workspace:
|
|
|
|
root: ./
|
|
|
|
paths:
|
|
|
|
- dist
|
|
|
|
- coverage
|
|
|
|
deploy:
|
|
|
|
<<: *docker_defaults
|
|
|
|
working_directory: ~/repo
|
|
|
|
steps:
|
|
|
|
- prep_env
|
|
|
|
- attach_workspace:
|
|
|
|
at: ./
|
2019-01-07 08:10:17 +00:00
|
|
|
- run: yarn codecov
|
|
|
|
- run: yarn semantic-release
|
2019-01-07 07:55:57 +00:00
|
|
|
workflows:
|
|
|
|
version: 2
|
2019-01-07 08:03:17 +00:00
|
|
|
validate_and_deploy:
|
2019-01-07 07:55:57 +00:00
|
|
|
jobs:
|
|
|
|
- node_modules
|
2019-01-07 08:03:17 +00:00
|
|
|
- validate:
|
2019-01-07 07:55:57 +00:00
|
|
|
requires:
|
|
|
|
- node_modules
|
2019-01-07 08:03:17 +00:00
|
|
|
- deploy:
|
|
|
|
requires:
|
|
|
|
- validate
|
2019-01-07 07:55:57 +00:00
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
only:
|
|
|
|
- master
|
|
|
|
|
|
|
|
experimental:
|
|
|
|
notify:
|
|
|
|
branches:
|
|
|
|
only:
|
|
|
|
- master
|