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 improvements #158

Merged
merged 3 commits into from
Sep 20, 2016
Merged

Travis improvements #158

merged 3 commits into from
Sep 20, 2016

Conversation

barryvdh
Copy link
Contributor

@barryvdh barryvdh commented Sep 8, 2016

Some improvements for Travis, which will speed it up a bit.

Also adds tests for 7.1 and tests the lowest version of the dependencies, eg. Symfony 2.7 instead of 3

  • Cache Composer files
  • Add php 7.1
  • Install lowest + normal dependencies

- Cache Composer files
- Add php 7.1
- Install lowest + normal dependencies
@@ -2,18 +2,31 @@ language: php

sudo: false

cache:
directories:
- $HOME/.composer/cache
Copy link
Collaborator

Choose a reason for hiding this comment

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

you should cache only the /files subfolder, to avoid invalidating the Travis cache on each builds because of the packagist metadata cache (builds on this repo are not happening often enough to benefit from the metadata cache anyway, as the cache will almost always be stale for next builds)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Does stale packagist metadata also invalidate the files then? I've updated the code, but if possible, I'm very interested in a source for this (as I use this exact code in multiple repositories).

Copy link
Collaborator

Choose a reason for hiding this comment

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

the composer cache folder contains several subdirectories:

  • files: contains downloaded archives (or downloaded single files for a mostly unknown).
  • vcs: contains clones of VCS repositories referenced directly (or also installed from source for git repositories in recent composer versions if your git version is new enough to support the necessary feature)
  • repositories: contains metadata files downloaded from composer repositories (packagist, satis, etc...)

As this Travis build installs stable releases of its dependencies, there is a good chance to have a cache hit for downloads (and these archives are bigger than metadata, making it a good idea to hit the cache). When the dependency makes a new release, we will miss the cache, and we will indeed also force Travis to store an updated cache at the end of the build.
On the other hand, Packagist metadata would almost always miss the cache (Packagist receives updates very often), and the package metadata we need (the Symfony component for instance) are unlikely to end up in the file containing packages not updated since months (Symfony is updated every few days).
So the metadata cache will not help us (we will still have to download them), and so the cost of downloading the Travis cache from the S3 and uploading the new cache to the S3 at the end of the build (as it will be updated each time) will not be outweighted by benefits.

@tijsverkoyen tijsverkoyen merged commit fb881a8 into tijsverkoyen:master Sep 20, 2016
@barryvdh barryvdh deleted the patch-6 branch September 20, 2016 12:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants