D4no0

D4no0

How you manage elixir/erlang versions in github actions?

I am currently digging in some CI scripts using github actions. They seem to be installing elixir/erlang using asdf and cache them afterwards. It seems they work pretty well currently, however this makes me question whether it is smart to compile OTP from source in a CI environment instead of using a pre-built image?

There are few clear benefits to the asdf approach:

  1. You can use .tools-versions to keep the versions for both dev and CI envs;
  2. You don’t have to rely on pre-built images availability, this can be both for older versions of OTP or bleeding edge ones.

My main concerns when I saw usage of asdf is: how controllable the env where OTP is compiled is? I can see how this can easily backfire when you want to use a older OTP version that doesn’t support openssl 3+.

I’ve took a look at some OSS projects like phoenix and it seems they are using erlef/setup-beam@v1 usually:

- name: Set up Elixir
  uses: erlef/setup-beam@v1
  with:
    elixir-version: ${{ matrix.elixir }}
    otp-version: ${{ matrix.otp }}

Any thoughts on this? My aim is to find the version of config that is the easiest to use and configure.

Most Liked

stefanluptak

stefanluptak

We’re using it like this and this step takes only 6s. What it does is just some unzipping etc., so no compilation involved.

- uses: erlef/setup-beam@v1
  id: setup-beam
  with:
    version-file: .tool-versions
    version-type: strict
stefanluptak

stefanluptak

No, I don’t, but it would be nice. Please post here if you find an elegant approach. I haven’t researched it yet.

BartOtten

BartOtten

You can also use a version matrix to test the project with multiple erlang/elixir combinations; although it causes some issues with ‘mix format —check-formatted’ as different versions use different formatting. Still need to fix it by making that check depending on the version.

Also: instead of asdf check mise; switched last year and never looked back.

https://github.com/BartOtten/routex/blob/main/.github/workflows/elixir.yml

Last Post!

akash-akya

akash-akya

Makes sense for Application.

In my case I also depend on few native libraries, some tools etc. And Nix fits perfectly with all those things without me having to configure caching.

Where Next?

Popular in Discussions Top

ben-pr-p
In general I’ve been sticking to this community style guide GitHub - christopheradams/elixir_style_guide: A community driven style guide ...
New
AstonJ
I’ve just started the Phoenix part of the utterly brilliant online course by @pragdave. On generating the Phoenix app he uses the --no-ec...
New
rms.mrcs
A couple of days ago I was discussing with a friend about different approaches to write microservices. He said that if he was going to w...
New
PragTob
Hello everyone, I know we had quite some threads (read through lots of them) about background job processing but it remains a hotly deba...
New
mikl
I wanted to capitalize a string, and tried using String.capitalize(). That generally works well, until you try to capitalize a word like...
New
AngeloChecked
What learn first? Rust or Elixir Hi Elixir community! I’m here because i want learn a new language. I’m a junior developer and mainly i ...
New
shishini
I think this twitter post and youtube video didn’t get as much attention as I hoped I am still new to Elixir, so can’t really judge ...
New

Other popular topics Top

KronicDeth
Elixir plugin for JetBrain’s IntelliJ Platform (including Rubymine) This is a plugin that adds support for Elixir to JetBrains IntelliJ...
289 36820 110
New
nobody
Hi! In PHP: $_SERVER[‘SERVER_ADDR’] - in Elixir? Searched the docs for ip address and the web, no good results. Thanks!
New
minhajuddin
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
New
lanycrost
Hi everyone! I need implement if…else if…else condition from my elixir code, and anymore of this control flow structures not work proper...
New
axelson
This post is a wiki (feel free to hit the edit button near the bottom right of this post to add your own changes!) This post collects co...
239 49266 226
New
shijith.k
I am trying to start a new phoenix project with elixir 1.9, but mix phx.new does not work. It says that ** (Mix) The task "phx.new" could...
New

We're in Beta

About us Mission Statement