Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update palette to use orbs #127

Merged
merged 2 commits into from Nov 14, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
95 changes: 37 additions & 58 deletions .circleci/config.yml
@@ -1,79 +1,58 @@
defaults: &defaults
working_directory: ~/artsy/palette
docker:
- image: circleci/node:8
version: 2.1

save_cache: &save_cache
save_cache:
key: yarn-deps-{{ checksum "yarn.lock" }}
paths:
- ./node_modules
orbs:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zephraph - if its not a pain would you mind also updating stitch? (I copied that config from here)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

node: artsy/node@0.0.1
yarn: artsy/yarn@0.0.2

restore_cache: &restore_cache
restore_cache:
keys:
- yarn-deps-{{ checksum "yarn.lock" }}
- yarn-deps-

verify_dependencies: &verify_dependencies
run: yarn --check-files

filter_master: &filter_master
filters:
branches:
only:
- master

version: 2
jobs:
update-cache:
<<: *defaults
steps:
- checkout
- <<: *restore_cache
- <<: *verify_dependencies
- <<: *save_cache
type-check:
<<: *defaults
steps:
- checkout
- <<: *restore_cache
- <<: *verify_dependencies
- run: yarn type-check
lint:
<<: *defaults
executor: node/build
steps:
- checkout
- <<: *restore_cache
- <<: *verify_dependencies
- yarn/setup
- run: yarn lint
test:
<<: *defaults
type-check:
executor: node/build
steps:
- checkout
- <<: *restore_cache
- <<: *verify_dependencies
- run: yarn test
- yarn/setup
- run: yarn type-check
deploy:
<<: *defaults
executor: node/build
steps:
- checkout
- <<: *restore_cache
- yarn/setup
# Setup the .npmrc with the proper registry and auth token to publish
- run: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
- run: yarn semantic-release
test:
executor: node/build
steps:
- yarn/setup
# Runs jest tests with 6 concurrent workers. Without limiting it to 6
# workers Jest will spawn many memory hungry workers and ultimately
# starve the job for memory.
- run: yarn test -w 6
update-cache:
executor: node/build
steps:
- yarn/update_dependencies

workflows:
version: 2
build_and_verify:
jobs:
- update-cache
- type-check
- lint
- type-check
- test
- deploy:
# The deploy job is the _only_ job that should have access to our npm
# tokens. We include a context that has our publish credentials
# explicitly in this step. https://circleci.com/docs/2.0/contexts/
context: npm-deploy
<<: *filter_master
filters:
branches:
only:
- master
requires:
- update-cache
- type-check
- lint
- test
- lint
- type-check
- update-cache