axelson
Install elixir from source on Travis-ci
So I’m trying to get automated testing running for elixir_sense but I’m running an issue. The tests only pass (currently) if Elixir is installed from source. So I want to see if I can install Elixir from source on Travis. Having not used Travis very much I’m not sure how to go about it. I know that you can add elixir: '1.7.0 to your .travis.yml to install elixir from a binary release, but I’m not sure about installing from source.
Of course I may also opt to get the test suite running without requiring a source-installation but I wanted to get everything setup on CI before that if possible.
Marked As Solved
NobbZ
Okay, solved it.
It seems as if due to restriction of how travis CI works, elixir isn’t really installed after running make install.
After I changed the script to use the elixir directly from the source folder, it worked. Also I prepared the git checkout already in a way, that you should be able to create a build matrix easily.
Latest build log: https://travis-ci.com/axelson/elixir_sense/builds/97754187
PR: Fix installation and usage of elixir in travis builds by NobbZ · Pull Request #1 · axelson/elixir_sense · GitHub
Also Liked
NobbZ
axelson
Wow, thanks for seeing that through. I’ll get it merged down soon (hopefully later today).
Last Post!
axelson
Here’s an updated example for anyone coming to this later (I had to remove any environment variables that depend on another environment variable):
language: erlang
otp_release:
- '21.2'
env:
EX_HOME: ${TRAVIS_BUILD_DIR}/elixir
EX_BIN: ${TRAVIS_BUILD_DIR}/elixir/bin
EX_VSN: 1.7.1
before_script:
- git clone https://github.com/elixir-lang/elixir.git ${EX_HOME}
- pushd ${EX_HOME}
- git checkout v${EX_VSN}
- make
- popd
- ${EX_BIN}/elixir ${EX_BIN}/mix local.hex --force
- ${EX_BIN}/elixir ${EX_BIN}/mix local.rebar --force
script:
- ${EX_BIN}/elixir ${EX_BIN}/mix deps.get
- MIX_ENV=test ${EX_BIN}/elixir ${EX_BIN}/mix deps.compile
- ${EX_BIN}/elixir ${EX_BIN}/mix test
Popular in Questions
Other popular topics
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
- #supervisor
- #elixirconf-us
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #security
- #hex









