The compilation and test of the projects usually take seconds locally, but may take several minutes on Travis CI. Most of the time is used on installing Mono every time. It seems wasteful of the build server resources.
I think this is by design. Travis CI uses containerized builds, meaning each build of your project gets a fresh image of some sort of C# (.NET Core) container, and it’s the deployment/startup of the container that takes so long.
The upside is that your builds are isolated from each other (and from everyone else’s builds/environments).
Right, but the same could be said for PHP, Node, and Python versions, which don’t generally take that long.
The actual reason it is taking long is because:
-
We are compiling part of Mono from source instead of downloading a precompiled package (or “bottle”). This is fixable, but would take some effort, possibly involving upstream, or non-trivial investment by the Travis community in improving the way the C# container installs Mono versions.
-
We are downloading large sources and binaries from external servers (I think?). This might get speed up if Travis hosted a mirror or cache proxy for some of those. Or, alternatively, the Mono version installer could be structured such that individual projects can simply add a certain directory to Travis built-in cache feature so that a compatible end-result from a previous build is re-used if found in the cache.