-
Notifications
You must be signed in to change notification settings - Fork 48
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
Add build job with turbo cache to CI #1615
Merged
+123
−181
Merged
Changes from 35 commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
ed0969f
test(jest): config cache directory
sungik-choi e256636
ci: move ci workflow fron circle ci to github actions
sungik-choi 986416d
ci: apply cache and refine each step
sungik-choi ba0572a
build: remove test:ci script and add jest cache to outputs of test pi…
sungik-choi 8dab4e6
chore(deps): move jest-relate packages from each packages to root pac…
sungik-choi 7a9c9cf
chore: remove onlyChanged flag of test script
sungik-choi 1815991
test: unify test setup with SWC and add cache directory
sungik-choi 337ea6f
ci(validate): improved execution of lint, typecheck, and test scripts…
sungik-choi 481b472
chore: add .jestcache to clean script
sungik-choi ea59e54
ci: seperate cache key based on workflow
sungik-choi 5a903e7
refactor(ci): use default fetch depth option of actions/checkout
sungik-choi 989a12b
refactor(ci): change the hard-coded node version to .nvmrc directory
sungik-choi 11e1dae
Merge branch 'main' into ci/build
sungik-choi 90f2750
chore(deps): clean up dependecies
sungik-choi 5a13673
ci(github): enhance chromatic workflow
sungik-choi 50a12a3
ci(github): format
sungik-choi d273587
ci(github): add alpha branch to chromatic trigger branch
sungik-choi 7c36660
build(turbo): define workspace-tasks
sungik-choi 542e3bd
ci(github): use turbo pipeline instead of custom validate script
sungik-choi eb10825
ci(github): fix chromatic workflow
sungik-choi e98c23e
Merge branch 'main' into ci/build
sungik-choi 1590bb6
ci(circle): revert config.yml
sungik-choi 9b79f79
build(packages): unify typecheck script
sungik-choi e0b140e
ci: remove ci github action and revert circle ci config file
sungik-choi 9866576
ci: add new line
sungik-choi 392fcc9
ci(circle): remove unnecessary token param
sungik-choi 2b2e9a3
ci(circle): remove disallowed key
sungik-choi eaecc7f
build(turbo): remove unnecessary workflow pipeline
sungik-choi 1629c28
ci(circle): changed to a single pipeline to reduce workspace attach p…
sungik-choi e9c1a49
Revert "ci(circle): changed to a single pipeline to reduce workspace …
sungik-choi 7a786af
ci(circle): enhance workspace and cache config
sungik-choi 7649906
ci(circle): fix workspace path
sungik-choi 43a6453
ci(circle): wip: add concurrency option to prevent SIGKILL
sungik-choi d5ada1b
ci(circle): change concurrency number from 2 to 1
sungik-choi 535a26f
ci(circle): use xlarge resource and remove concurrency option
sungik-choi 76d7b6d
ci(chromatic): remove unnecessary diffs
sungik-choi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
version: 2.1 | ||
|
||
orbs: | ||
codecov: codecov/codecov@1.2.0 | ||
node: circleci/node@5.1.0 | ||
codecov: codecov/codecov@3.3.0 | ||
|
||
references: | ||
workspace_root: &workspace_root | ||
|
@@ -10,74 +11,98 @@ references: | |
attach_workspace: &attach_workspace | ||
attach_workspace: | ||
at: *workspace_root | ||
|
||
build_cache_paths: &build_cache_paths | ||
paths: | ||
- node_modules/.cache/turbo | ||
|
||
defaults: &defaults | ||
resource_class: xlarge | ||
working_directory: *workspace_root | ||
lint_cache_paths: &lint_cache_paths | ||
paths: | ||
- packages/bezier-react/.stylelintcache | ||
- packages/bezier-react/.eslintcache | ||
- packages/bezier-icons/.eslintcache | ||
- packages/bezier-figma-plugin/.eslintcache | ||
- packages/bezier-codemod/.eslintcache | ||
|
||
docker: | ||
- image: node:18.17.1 | ||
test_cache_paths: &test_cache_paths | ||
paths: | ||
- packages/bezier-react/.jestcache | ||
- packages/bezier-icons/.jestcache | ||
- packages/bezier-figma-plugin/.jestcache | ||
- packages/bezier-codemod/.jestcache | ||
|
||
filter_only_tagged: &filter_only_tagged | ||
filters: | ||
tags: | ||
only: /^v.*/ | ||
branches: | ||
ignore: /.*/ | ||
executors: | ||
node_executor: | ||
docker: | ||
- image: node:18.17.1 | ||
resource_class: xlarge | ||
working_directory: *workspace_root | ||
|
||
jobs: | ||
install: | ||
<<: *defaults | ||
executor: node_executor | ||
steps: | ||
- checkout | ||
- restore_cache: | ||
keys: | ||
- bezier-react-dependencies-{{ checksum "yarn.lock" }} | ||
- run: yarn install | ||
- save_cache: | ||
paths: | ||
- .yarn/cache | ||
- .yarn/unplugged | ||
key: bezier-react-dependencies-{{ checksum "yarn.lock" }} | ||
- node/install-packages: | ||
pkg-manager: yarn | ||
- persist_to_workspace: | ||
root: *workspace_root | ||
paths: | ||
- . | ||
|
||
build: | ||
<<: *defaults | ||
executor: node_executor | ||
steps: | ||
- *attach_workspace | ||
- run: yarn build --filter=bezier-icons | ||
- restore_cache: | ||
keys: | ||
- build-{{ .Environment.CACHE_VERSION }}-{{ .Branch }}- | ||
- build-{{ .Environment.CACHE_VERSION }}- | ||
- run: yarn build | ||
- save_cache: | ||
key: build-{{ .Environment.CACHE_VERSION }}-{{ .Branch }}-{{ epoch }} | ||
<<: *build_cache_paths | ||
- persist_to_workspace: | ||
root: *workspace_root | ||
paths: | ||
- . | ||
|
||
lint: | ||
<<: *defaults | ||
executor: node_executor | ||
steps: | ||
- *attach_workspace | ||
- restore_cache: | ||
keys: | ||
- lint-{{ .Environment.CACHE_VERSION }}-{{ .Branch }}- | ||
- lint-{{ .Environment.CACHE_VERSION }}- | ||
- run: yarn lint | ||
- save_cache: | ||
key: lint-{{ .Environment.CACHE_VERSION }}-{{ .Branch }}-{{ epoch }} | ||
<<: *lint_cache_paths | ||
|
||
typecheck: | ||
<<: *defaults | ||
executor: node_executor | ||
steps: | ||
- *attach_workspace | ||
- run: yarn typecheck | ||
|
||
test: | ||
<<: *defaults | ||
executor: node_executor | ||
steps: | ||
- *attach_workspace | ||
- run: yarn test:ci | ||
- restore_cache: | ||
keys: | ||
- test-{{ .Environment.CACHE_VERSION }}-{{ .Branch }}- | ||
- test-{{ .Environment.CACHE_VERSION }}- | ||
- run: yarn test | ||
- codecov/upload: | ||
file: './packages/bezier-react/coverage/lcov.info' | ||
token: $CODECOV_TOKEN | ||
- save_cache: | ||
key: test-{{ .Environment.CACHE_VERSION }}-{{ .Branch }}-{{ epoch }} | ||
<<: *test_cache_paths | ||
|
||
workflows: | ||
version: 2 | ||
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. deprecated |
||
lint_and_test: | ||
ci: | ||
jobs: | ||
- install | ||
- build: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -215,3 +215,6 @@ stats.html | |
|
||
# Rollup cache | ||
.rollup.cache | ||
|
||
# Jest cache | ||
.jestcache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,12 @@ | ||
/** @type {import('ts-jest').JestConfigWithTsJest} */ | ||
/** @type {import('jest').Config} */ | ||
module.exports = { | ||
preset: 'ts-jest/presets/default-esm', | ||
cacheDirectory: '.jestcache', | ||
testEnvironment: 'node', | ||
transform: { | ||
'^.+\\.[t|j]sx?$': ['@swc/jest'], | ||
}, | ||
moduleNameMapper: { | ||
'^(\\.{1,2}/.*)\\.js$': '$1', | ||
}, | ||
transform: { | ||
// '^.+\\.[tj]sx?$' to process js/ts with `ts-jest` | ||
// '^.+\\.m?[tj]sx?$' to process js/ts/mjs/mts with `ts-jest` | ||
'^.+\\.tsx?$': [ | ||
'ts-jest', | ||
{ | ||
useESM: true, | ||
}, | ||
], | ||
}, | ||
testEnvironment: 'node', | ||
testRegex: '\\.test\\.ts$', | ||
testMatch: ['**/*.test.(ts|tsx)'], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/** @type {import('jest').Config} */ | ||
module.exports = { | ||
cacheDirectory: '.jestcache', | ||
testEnvironment: 'jsdom', | ||
transform: { | ||
'^.+\\.[t|j]sx?$': ['@swc/jest'], | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,5 +6,6 @@ | |
".eslintrc.js", | ||
"babel.config.js", | ||
"rollup.config.mjs", | ||
"jest.config.js", | ||
], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
unused