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

Travis CI: Cache $HOME/.npm #5865

Merged
merged 1 commit into from
Mar 29, 2018
Merged

Travis CI: Cache $HOME/.npm #5865

merged 1 commit into from
Mar 29, 2018

Conversation

ntwb
Copy link
Member

@ntwb ntwb commented Mar 29, 2018

Description

The addition of Puppeteer in #5618 adds an ~75MB binary to node_modules as part of the npm install process, this PR adds $HOME/.npm to the Travis CI cache with the goal to improving subsequent Travis CI build/job times.

How Has This Been Tested?

Testing this PR results to follow in comments from Travis CI test results

Screenshots (jpeg or gifs if applicable):

Types of changes

Build tooling improvement to allow faster Travis CI build results

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code has proper inline documentation.

@ntwb ntwb added the [Type] Build Tooling Issues or PRs related to build tooling label Mar 29, 2018
@ntwb
Copy link
Member Author

ntwb commented Mar 29, 2018

Via https://travis-ci.org/WordPress/gutenberg/caches

Branch Time Size
Pushes
master 20 days ago 110.58MB
Pull Requests
PR.4398 20 days ago 0.00MB
PR.4725 20 days ago 0.00MB
PR.5269 20 days ago 0.00MB
PR.5279 19 minutes ago 141.87MB
PR.5423 20 days ago 54.69MB
PR.5507 20 days ago 54.69MB
PR.5854 about 5 hours ago 0.00MB

As can be seen from the above table the only cache recently used by Travis CI was build PR.5279 of #5279 of which I pushed up changes to (and subsequently broke whilst rebasing 😏 )

I believe the reason why the previous cache located at $HOME/.composer/cache is not currently caching anything is due to Composer runs in Docker containers, why there is no cache for $HOME/.phpbrew will need further investigation.

Via https://travis-ci.org/WordPress/gutenberg/caches after this PR Travis CI completed successfully

Branch Time Size
Pull Requests
PR.5865 4 minutes ago 141.87MB

@ntwb
Copy link
Member Author

ntwb commented Mar 29, 2018

Checking that npm cache is added:

Travis Job #17883.1

This confirms previusly that npm wasn't cached:

https://travis-ci.org/WordPress/gutenberg/jobs/359640282#L454

Setting up build cache
$ export CASHER_DIR=$HOME/.casher
0.21s$ Installing caching utilities
0.00s
4.78sattempting to download cache archive
fetching PR.5279/cache-linux-trusty-e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855--php-5.5.tgz
fetching PR.5279/cache--php-5.5.tgz
fetching master/cache-linux-trusty-e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855--php-5.5.tgz
found cache
0.01s
2.26sadding /home/travis/.composer/cache to cache
creating directory /home/travis/.composer/cache
adding /home/travis/.phpbrew to cache
creating directory /home/travis/.phpbrew
adding /home/travis/.npm to cache
npm is not yet cached

This confirms npm is now cached:

https://travis-ci.org/WordPress/gutenberg/jobs/359640282#L3623

The command "npm run ci || exit 1" exited with 0.
cache.2
store build cache
0.00s
3.98schange detected (content changed, file is created, or file is deleted):
/home/travis/.npm/anonymous-cli-metrics.json
/home/travis/.npm/_cacache/content-v2/sha1/00/a9/f7387556e27038eae232caa372a6a59b665a
/home/travis/.npm/_cacache/content-v2/sha1/00/c1/cdb1aca71112cdf0cf6126c2ed6b457ccdbc
/home/travis/.npm/_cacache/content-v2/sha1/01/8e/c7a4ce7e3a86cb9141be519d24c8faa981b5
/home/travis/.npm/_cacache/content-v2/sha1/01/fc/bbb393463a548f2f466cce16dece49db908f
/home/travis/.npm/_cacache/content-v2/sha1/02/89/88bb7fe8b2e6645676d82052587d440b02d3
/home/travis/.npm/_cacache/content-v2/sha1/03/19/1c432cb6eea168bb77f3a55ffdccb8978514
/home/travis/.npm/_cacache/content-v2/sha1/03/71/ab4ae0bdd720d4166d7dfda64ff7a445a6c0
/home/travis/.npm/_cacache/content-v2/sha1/04/21/e339fd71419b3da13d129b3979040230476e
/home/travis/.npm/_cacache/content-v2/sha1/04/5f/9782d011ae9a6803ddd382b24392b3d890f7
/home/travis/.npm/_cacache/content-v2/sha1/04/e6/926f662895354f3dd015203633b857297e2c
/home/travis/.npm/_cacache/content-v2/sha1/05/37/cb79daf59b59a1a517dff706c86ec039162e
/home/trav
...
changes detected, packing new archive
uploading archive

@danielbachhuber danielbachhuber added this to the 2.6 milestone Mar 29, 2018
@danielbachhuber danielbachhuber self-requested a review March 29, 2018 14:58
@danielbachhuber danielbachhuber merged commit 2da5333 into master Mar 29, 2018
@danielbachhuber danielbachhuber deleted the try/cache-npm branch March 29, 2018 14:58
@aduth
Copy link
Member

aduth commented Apr 3, 2018

Related: #5854

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Build Tooling Issues or PRs related to build tooling
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants