-
Notifications
You must be signed in to change notification settings - Fork 3.5k
[CI] Cache the result of pip install and npm install #26338
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
base: main
Are you sure you want to change the base?
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 |
|---|---|---|
|
|
@@ -57,7 +57,14 @@ commands: | |
| bootstrap: | ||
| description: "bootstrap" | ||
| steps: | ||
| - restore_cache: | ||
| keys: | ||
| - bootstrap-node-deps-{{ arch }}-{{ checksum "package-lock.json" }} | ||
| - run: ./bootstrap | ||
| - save_cache: | ||
| key: bootstrap-node-deps-{{ arch }}-{{ checksum "package-lock.json" }} | ||
| paths: | ||
| - node_modules | ||
| pip-install: | ||
| description: "pip install" | ||
| parameters: | ||
|
|
@@ -66,9 +73,22 @@ commands: | |
| type: string | ||
| default: python3 | ||
| steps: | ||
| - restore_cache: | ||
| keys: | ||
| - python-deps-v2-{{ arch }}-checksum "requirements-dev.txt" }} | ||
| - run: | ||
| name: pip install | ||
| command: << parameters.python >> -m pip install -r requirements-dev.txt | ||
| command: | | ||
| if [[ -e ~/.cache/pip ]]; then | ||
| echo "Skipping npm ci due to cache hit" | ||
|
Member
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. If everything is already there, isn't npm ci just a no-op that runs fast?
Member
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. Oh, actually this is pip, so the echo should be updated. but same question. i.e. could we just run the command anyway. |
||
| else | ||
| << parameters.python >> -m pip install -r requirements-dev.txt | ||
| fi | ||
| - save_cache: | ||
| key: python-deps-v2-{{ arch }}-{{ checksum "requirements-dev.txt" }} | ||
| paths: | ||
| - ~/.cache/pip | ||
| - ~/.local/bin | ||
| install-rust: | ||
| steps: | ||
| - run: | ||
|
|
@@ -557,10 +577,24 @@ jobs: | |
| executor: linux-node | ||
| steps: | ||
| - checkout | ||
| - run: npm ci | ||
| - restore_cache: | ||
| keys: | ||
| - node-deps-{{ arch }}-{{ checksum "package-lock.json" }} | ||
| - run: | ||
| name: npm ci | ||
| command: | | ||
| if [[ -e node_modules ]]; then | ||
| echo "Skipping npm ci due to cache hit" | ||
| else | ||
| npm ci | ||
| fi | ||
| - run: | | ||
| npm run lint | ||
| npm run check | ||
| - save_cache: | ||
| key: node-deps-{{ arch }}-{{ checksum "package-lock.json" }} | ||
| paths: | ||
| - node_modules | ||
| test-sanity: | ||
| executor: ubuntu-lts | ||
| steps: | ||
|
|
||
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.
why v2 here?