Speedup Travis by tweaking your Dist::Zilla config
Dist::Zilla is a great tool... but its main weakness is nearly its main advantage...
In My Opinion, Dist::Zilla Plugins are what makes my dzil workflow so great....
but on the other side, installing all the plugins and their dependencies is painful and can be very slow...
It's acceptable to install all these packages that are going to let you save time while developing and releasing your distro.... but contributors and Travis CI should not be slowed down by requiring the installation of these extra packages...
By tweaking the dist.ini of my distro by using a combo of GatherDir + Run::AfterBuild plugins, I could reduced the travis build time for a single Perl version from more than 4 minutes to about 30 seconds...
When smoking with Perl versions from 5.14 to 5.28 the total build time was reduced from 32 min to 5 min.
; extract from dist.ini
exclude_filename = Makefile.PL
; provide a friendly Makefile.PL in our repo
; Travis CI and other contributors does not need
; to install Dist::Zilla::*
run = cp %d/Makefile.PL ./
run = git status --porcelain | grep 'M Makefile.PL' \
&& git commit -m 'Makefile.PL auto-updated by dist.ini' Makefile.PL \
&& echo "# Makefile.PL auto-update" \
|| echo "# Makefile.PL up to date"
It will automatically steal (/copy) the Makefile.PL when running a build and copy it to your codebase, then commit it if needed.
Note that you need to be sure that the file Makefile.PL is not gathered when building a distro.
Ovid also came with one alternate suggestion
run = ( test -f Makefile.PL && rm Makefile.PL ) ||:
which in my case became useless with the GatherDr exclusion.
I guess this could probably be provided as Dist::Zilla plugin so it could be easier to reuse in other distro. Maybe there is already such a plugin available?
Anyway, I thought this would worth sharing as some other authors can take benefits of having their Travis CI builds running faster when using Dist::Zilla :-)
This is a small change to your dist.ini file, that could let you help save a lot of time.