-
Notifications
You must be signed in to change notification settings - Fork 23
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
added docs on how to cache dependencies within a github action #50
Comments
As far as I can tell the example depends on Even if there is additional vendors, the downloaded files are cached in the same directory: be it from a global dependency, your project one or a composer-bin-plugin one |
hmm I guess you are right, since the composer-bin-plugin does only change the working directory and composer.json but not the |
after a few more tests I can see that it is not enough to configure the regular caching. e.g. for php-cs-fixer you need something like
|
why is the nested composer.json necessary if you capture the lock one? |
because I dont have a composer.lock committed within vendor-bin/ |
oh then yes, you need at least the json then :) |
If you think that helps I'll welcome a PR to the doc to clarify that point :) |
the main point is, that we need a lot more caching then just caching the regular composer vendor/. you also need to cache the vendor-bin/$my-tool/vendor |
It depends by what you want to cache. Traditionally, at least that is what I was doing in Travis and GitLab CI, I cache the Composer downloaded artefacts, not the vendor itself. In this sense it doesn't matter which vendor (be it a bin one or not) it is. The hash keys also matters less: I don't need to invalidate that cache (although I still can), Composer handles that for me. If you cache the vendor directories then it's another story entirely. But IMO it's making things more complicated than necessary |
let me be more precise:
when only using the regular composer caching like described in https://github.com/shivammathur/setup-php#cache-composer-dependencies |
Can you double check the value of |
I dont thinks thats relevant, because the example from shivammathur/setup-php uses a variable for that path:
however, the value is |
just to be sure we are on the same page. regular project dependencies get installed into |
@staabm the vendors should be installed in Also just in case: I remember on Travis it needed to land on the master branch first before seeing the effects in the PR. Might be the same here |
when using this plugin, composer installs the vendors into additional folders.
would be great to have a copy & paste'table example on how to cache this dependencies within a Github Action run.
something along the lines of https://github.com/shivammathur/setup-php#cache-composer-dependencies but adjusted for the composer-bin-plugin use-case
The text was updated successfully, but these errors were encountered: