Qqwy

Qqwy

TypeCheck Core Team

How to cache the Elixir compilation on Travic CI?

We’re adding continuous integration to our application.

@sorentwo was able to give me some advice to split up the testing into separate stages, but the main issue: compilation time having a huge impact on CI-execution times, remains.

Currently, running the test takes about 20 seconds. However, compiling the project from scratch the first time takes a whopping 140 seconds. On Travis CI, this compilation is done on every test run, significantly slowing down the feedback loop.

I’ve tried to cache the compilation/build artefacts by adding the _build-directory to the Travis CI cache, but I’m not sure if I either made a mistake in how Travis’ caching configuration should be used, or in how Mix decides to re-compile your dependencies, because it is still compiling everything during every test run.
see for instance this test run

The Travis CI config that is currently being used can be found here.

Marked As Solved

NobbZ

NobbZ

You have not added deps to the cache, so you have to re-download the dependencies again each time, and as you have recently downloaded them the compiler will recompile them. And as deps are recompiled, your own application will as well.

Also Liked

Qqwy

Qqwy

TypeCheck Core Team

Ah, I see! :heart_eyes:

Awesome! With this change, any build only takes about a minute, rather than almost four :sunglasses:.

sorentwo

sorentwo

Oban Core Team

Ah, of course, caching the deps makes total sense. In our CircleCI builds we cache the deps and _build directories using their powerful but highly obtuse build configuration. It didn’t occur to me to do the same for Travis.

Where Next?

Popular in Questions Top

sen
Hi All, I set a environment variables in dev.exs , like below code. when i start server, how can i set the ${enable} value? thanks. d...
New
greenz1
I have a phoenix application from which a user can download multiple(5-6) files of size 1MB. I couldn’t find anything related to sending ...
New
electic
Hi, I am new to Elixir. I am trying to use the DateTime component to insert a date into MySQL however the there seems to be no way to fo...
New
shahryarjb
Hello, I get Persian date from my client and convert it to normal calendar like this: def jalali_string_to_miladi_english_number(persi...
New
jaysoifer
Is there a way to rollback a specific migration and only that one (“skipping” all the other ones)? Would mix ecto.rollback -v 200809061...
New
vrod
I am using the Starship cross-shell prompt – it seems pretty nice, but I get some errors: [WARN] - (starship::utils): Executing command ...
New
sergio_101
I am VERY much an elixir newbie. I have taken one elixir course and one phoenix course on Udemy. During that course, I saw the instructor...
New
srinivasu
How to handle excepions in elixir? Suppose i have A, B, C ,D, E modules. and each module has get() function. A.get() method will call t...
New
WestKeys
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New
vonH
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New

Other popular topics Top

marius95
Hello everyone, I try to use an Javascript Event Handler in my root.html.leex file. Therefore I created a function in the app.js file: ...
New
malloryerik
Hi, this is for people who, like me, have had some friction using .html.heex templates in VSCode. The solution seems to be, in a hyphena...
New
siddhant3030
Hi, I have to write a raw query for one of my project. But till now I have used ecto queries and don’t have much experience writing raw ...
New
chrismccord
As promised, the first release candidate of Phoenix 1.3.0 is out! This release focuses on code generators with improved project structure...
New
chrismccord
Phoenix 1.4.0 released Phoenix 1.4 is out! This release ships with exciting new features, most notably with HTTP2 support, improved deve...
688 30877 112
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New
PeterCarter
There are pre-rolled solutions for other frameworks that do work. However, Phoenix does not seem to have these. Have people had good expe...
New
AstonJ
Seen any cool LiveView demos, sample apps or examples? Please post them here! :003:
New
dogweather
I wrote this comment on r/haskell, and it’s not popular there. :wink: But I think I’m on to something… Haskell reminds me of Java, and e...
New

We're in Beta

About us Mission Statement