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:
- You can use
.tools-versionsto keep the versions for both dev and CI envs; - 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
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
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
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
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.
Popular in Discussions
Other popular topics
Chat & Discussions>Discussions
Latest on Elixir Forum
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #elixirconf-us
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #security
- #hex









