How to use GitHub Actions in an Elixir project

How to use GitHub Actions in an Elixir project
Average rating: 0
(0 votes)

Thanks! You’ve rated this material!

There’s a lot of things that could be done with Elixir. In this article, we are going to demonstrate how to use GitHub Actions in an Elixir project.

The Dockerfile for the action is relatively straightforward. It is based on the “elixir” image, and makes just a couple of small changes.

So that’s an overview of how Mix action works:

  1. Build from the Elixir image.
  2. Set $MIX_HOME so that it isn’t overridden at runtime.
  3. Use an entrypoint script for shell variable expansion.

Adding an action for running the tests is easy. Use the mix action again, except this time “args” is simply “test”, for running mix test. The final action is adding to this workflow to check our formatting using mix format. Since the project’s dependencies are not necessary for formatting code, you can run the format action from the root of the workflow, rather than waiting for dependencies to be fetched.

Check here for examples.

Read more about building an Elixir HTTP server.

Rate this article, if you like it

Thanks! You’ve rated this material!

Got a project? Let's discuss it!

    Kyiv Sofiivska 1/2a, 01001, Kyiv, Ukraine
    Dnipro Hlinky 2, of. 1003, 49000, Dnipro, Ukraine
    Kharkiv Otakara Yarosha 22, 61000, Kharkiv, Ukraine