8000 Cache node_modules on Azure Pipelines by as-cii · Pull Request #19437 · atom/atom · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on Mar 3, 2023. It is now read-only.

Cache node_modules on Azure Pipelines #19437

Merged
merged 3 commits into from
Jun 4, 2019
Merged

Cache node_modules on Azure Pipelines #19437

merged 3 commits into from
Jun 4, 2019

Conversation

as-cii
Copy link
Contributor
@as-cii as-cii commented Jun 3, 2019

Refs: #19366

This pull request's aim is to speed up our CI build times by taking advantage of https://github.com/microsoft/azure-pipelines-artifact-caching-tasks on this repository.

Caches are looked up by a key based on the contents of all package-lock.json files in the repository. When (at least) one of them changes, the cache won't be used and dependencies will be re-bootstrapped from scratch. We could probably find ways of starting with a base set of dependencies (e.g., the ones found on master) and only perform a partial bootstrap, but @rafeca pointed out that this could lead to some non-determinism in the package installed by npm. Maybe this is one argument in favor of switching to yarn at some point.

For now, this pull request picks the low-hanging fruit of skipping script/bootstrap entirely if the lockfile perfectly matches the set of dependencies that we have in the cache. When that happens, it saves ~8-9 minutes of build time.

Next Steps

In the future, we may want to investigate a couple of different options:

@as-cii as-cii force-pushed the as/ci-caching branch 3 times, most recently from 775f07e to 0baaa4f Compare June 3, 2019 15:31
Co-Authored-By: Nathan Sobo <nathan@github.com>
Co-Authored-By: Rafael Oleza <rafeca@github.com>
@as-cii as-cii marked this pull request as ready for review June 4, 2019 10:47
@as-cii as-cii requested review from rafeca and nathansobo June 4, 2019 10:47
Copy link
Contributor
@rafeca rafeca left a comment

Choose a reason for hiding this comment

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

🎉🎉🎉🎉🎉🎉🎉

@as-cii as-cii merged commit a21a2e3 into master Jun 4, 2019
@as-cii as-cii deleted the as/ci-caching branch June 4, 2019 11:45
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0