-
Notifications
You must be signed in to change notification settings - Fork 64
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
chore(ci): split ci jobs #610
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,38 +2,196 @@ version: 2.1 | |
orbs: | ||
node: circleci/node@4.7.0 | ||
|
||
jobs: | ||
build: | ||
executor: | ||
name: node/default | ||
tag: '14.16' | ||
################################################################################# | ||
# Aliases | ||
################################################################################# | ||
default_executor: &default_executor | ||
executor: | ||
name: node/default | ||
tag: '14.16' | ||
|
||
filter_branch: &filter_branch | ||
filters: | ||
branches: | ||
ignore: gh-pages | ||
|
||
################################################################################# | ||
# Commands | ||
################################################################################# | ||
commands: | ||
yarn-install: | ||
parameters: | ||
cache-version: | ||
type: string | ||
default: v4 | ||
description: Change the cache version if you need to clear the cache for any reason. | ||
|
||
steps: | ||
- checkout | ||
- restore_cache: | ||
keys: | ||
- node-deps-<<parameters.cache-version>>-{{ checksum "package.json" }}-{{ checksum "yarn.lock" }} | ||
- node-deps-<<parameters.cache-version>>-{{ checksum "package.json" }} | ||
- node-deps-<<parameters.cache-version>> | ||
|
||
- run: | ||
name: yarn install | ||
command: | | ||
CKSUM_BEFORE=$(cksum yarn.lock) | ||
yarn install | ||
CKSUM_AFTER=$(cksum yarn.lock) | ||
if [[ $CKSUM_BEFORE != $CKSUM_AFTER ]]; then | ||
echo "yarn.lock was modified unexpectedly - terminating" | ||
exit 1 | ||
fi | ||
- save_cache: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Custom cache since circle's node orb doesn't fully work with workspaces. |
||
key: node-deps-<<parameters.cache-version>>-{{ checksum "package.json" }}-{{ checksum "yarn.lock" }} | ||
paths: | ||
- node_modules | ||
- packages/big-design/node_modules | ||
- packages/big-design-theme/node_modules | ||
- packages/big-design-icons/node_modules | ||
- packages/configs/node_modules | ||
- packages/docs/node_modules | ||
- packages/examples/node_modules | ||
|
||
pre-setup: | ||
steps: | ||
- checkout | ||
- node/install-yarn: | ||
version: 1.22.10 | ||
version: 1.22.15 | ||
- yarn-install | ||
|
||
- node/install-packages: | ||
with-cache: true | ||
cache-version: v3 | ||
include-branch-in-cache-key: false | ||
pkg-manager: yarn | ||
attach-built-icons: | ||
steps: | ||
- attach_workspace: | ||
at: . | ||
|
||
- run: | ||
command: yarn run ci | ||
environment: | ||
NEXT_TELEMETRY_DISABLED: '1' | ||
################################################################################# | ||
# Jobs | ||
################################################################################# | ||
jobs: | ||
build-icons: | ||
<<: *default_executor | ||
|
||
- run: | ||
command: yarn run lint | ||
steps: | ||
- pre-setup | ||
- run: yarn workspace @bigcommerce/big-design-icons run build | ||
- persist_to_workspace: | ||
root: . | ||
paths: | ||
- packages/big-design-icons/dist | ||
|
||
build-theme: | ||
<<: *default_executor | ||
|
||
steps: | ||
- pre-setup | ||
- run: yarn workspace @bigcommerce/big-design-theme run build | ||
|
||
build-big-design: | ||
<<: *default_executor | ||
|
||
steps: | ||
- pre-setup | ||
- attach-built-icons | ||
- run: yarn workspace @bigcommerce/big-design run build | ||
|
||
build-examples: | ||
<<: *default_executor | ||
|
||
steps: | ||
- pre-setup | ||
- attach-built-icons | ||
- run: yarn workspace @bigcommerce/examples run build | ||
|
||
build-docs: | ||
<<: *default_executor | ||
|
||
parameters: | ||
cache-version: | ||
type: string | ||
default: v1 | ||
description: Change the next.js cache version if you need to clear the cache for any reason. | ||
|
||
steps: | ||
- pre-setup | ||
- attach-built-icons | ||
- restore_cache: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Adds cache to next.js build. |
||
keys: | ||
- nextjs-<<parameters.cache-version>>-{{ checksum "package.json" }}-{{ checksum "yarn.lock" }} | ||
- nextjs-<<parameters.cache-version>>-{{ checksum "package.json" }} | ||
- nextjs-<<parameters.cache-version>> | ||
- run: yarn workspace @bigcommerce/docs run build | ||
- save_cache: | ||
key: nextjs-<<parameters.cache-version>>-{{ checksum "package.json" }}-{{ checksum "yarn.lock" }} | ||
paths: | ||
- packages/docs/.next | ||
|
||
typeCheck: | ||
<<: *default_executor | ||
|
||
steps: | ||
- pre-setup | ||
- attach-built-icons | ||
- run: yarn run ci:typeCheck | ||
|
||
lint: | ||
<<: *default_executor | ||
|
||
steps: | ||
- pre-setup | ||
- attach-built-icons | ||
- run: yarn run lint | ||
|
||
test: | ||
<<: *default_executor | ||
|
||
steps: | ||
- pre-setup | ||
- attach-built-icons | ||
- run: yarn run ci:test | ||
|
||
################################################################################# | ||
# Workflows | ||
################################################################################# | ||
workflows: | ||
version: 2 | ||
build_and_test: | ||
jobs: | ||
- build: | ||
filters: | ||
branches: | ||
ignore: gh-pages | ||
- build-icons: | ||
<<: *filter_branch | ||
|
||
- build-theme: | ||
<<: *filter_branch | ||
|
||
- build-big-design: | ||
<<: *filter_branch | ||
requires: | ||
- build-icons | ||
|
||
- build-examples: | ||
<<: *filter_branch | ||
requires: | ||
- build-icons | ||
|
||
- build-docs: | ||
<<: *filter_branch | ||
requires: | ||
- build-icons | ||
|
||
- typeCheck: | ||
<<: *filter_branch | ||
requires: | ||
- build-icons | ||
|
||
- lint: | ||
<<: *filter_branch | ||
requires: | ||
- build-icons | ||
|
||
- test: | ||
<<: *filter_branch | ||
requires: | ||
- build-icons |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,9 @@ | |
"scripts": { | ||
"build": "lerna run build --stream", | ||
"build:icons": "yarn workspace @bigcommerce/big-design-icons run build", | ||
"ci": "lerna run ci --stream", | ||
"ci:typeCheck": "lerna run typeCheck --stream", | ||
"ci:test": "lerna run test --stream -- --maxWorkers=2 --coverage", | ||
"ci:build": "lerna run build --stream", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🍹 can remove |
||
"diff": "lerna diff", | ||
"lint": "eslint . --ext .ts,.tsx,.js", | ||
"start": "yarn workspace @bigcommerce/docs run start", | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bringing back the custom
yarn.lock
check since--forzen-lockfile
doesn't error out on workspaces.