anthonator

anthonator

Caching Dialyzer output with GitHub Actions

Hey everyone!

I’m curious why Dialyzer does a full analysis even when I cache the _build directory when using GitHub Actions. My deps directory is also cached and that works fine. It doesn’t try to pull deps if they’re cached.

My Dialyzer setup is pretty vanilla. I include dialyxir (1.0.0-rc) in my project and run mix dialyzer. No additional configuration in mix.exs.

Here’s the relevant section for my workflow config.

Thanks in advance to anyone that can help.

dialyzer:
  runs-on: ubuntu-latest

  strategy:
    matrix:
      elixir: [1.9-alpine]

    steps:
      - uses: actions/checkout@v1

      - uses: actions/cache@v1

        with:
          path: deps

          key: dependencies-${{ hashFiles('mix.lock') }}

      - uses: actions/cache@v1

        with:
          path: _build

          key: build-${{ hashFiles('mix.lock') }}

      - name: Pull elixir:${{ matrix.elixir }}

        run: docker pull elixir:${{ matrix.elixir }}

      - name: Run mix dialyzer

        run: |
          cmd='
            mix local.hex --force;
            mix local.rebar --force;
            mix deps.get;
            mix dialyzer;
          '

          docker run \
            --mount type=bind,src=`pwd`,target=/usr/src/malomo-bus \
            -w /usr/src/malomo-bus elixir:${{ matrix.elixir }} \
            /bin/ash -c "$cmd"

Most Liked

mhanberg

mhanberg

Creator of elixir-tools

Side note, I think you should include the elixir and erlang version in your cache-keys, so that it will break the cache when you increment those versions.

Typically you would add a version (v1) to the key, but since GH Actions puts the versions in your matrix in scope you can use those.

anthonator

anthonator

Oops, just noticed I have a typo. It should be :plt_core_path instead of :plt_cor_path.

NobbZ

NobbZ

The PLTs are not where you expect them, please read the PLT section in the dialyxir manual. There you will also learn how to adjust the settings to suite your CI:

anthonator

anthonator

This was it. Setting :plt_cor_path to "_build/#{Mix.env()}" in mix.exs did the trick. CI builds are super quick now.

Where Next?

Popular in Questions Top

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
tduccuong
Hi, is there any work on GUI with Elixir, that is similar to Electron/Javascript? My idea is to bundle Phoenix and BEAM into a single se...
New
SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
New
mcarvalho
What is the difference between System.get_env and Application.get_env? For example, what are best practices to use one versus another.
New
gonzofish
I’m currently trying to understand how to join three tables using Ecto. All the examples I’ve seen use 2, so maybe I’m just missing somet...
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
baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New
kostonstyle
Hi all I want to have a unix time, from the current time plus 1 hour. DateTime.now + 1 hour How to get it in elixir? Thanks
New
beno
I will often find my self writing things similar to: case some_value do nil -> something() "" -> something() _ -> someth...
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

Other popular topics Top

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 30048 115
New
peerreynders
Manning 2016 Halloween weekend sale via Deal of the Day Friday, October 28 - Half off all MEAPs - code WM102816LT Saturday, October 29 ...
326 29600 154
New
William
I would like to know that is there any online source for learning Phoenix Framework for building E-Commerce Store? Any advantage on build...
New
yawaramin
In the Dialyzer docs ( http://erlang.org/doc/man/dialyzer.html#requesting-or-suppressing-warnings-in-source-files ), there is a way to tu...
New
albydarned
Hello all! I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
New
aalberti333
As the title describes, I’m trying to run Enum.map() over a list of key/value pairs, where the value is a map. My data looks like this: ...
New
KronicDeth
Elixir plugin for JetBrain’s IntelliJ Platform (including Rubymine) This is a plugin that adds support for Elixir to JetBrains IntelliJ...
289 35421 110
New
SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
New
vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
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

We're in Beta

About us Mission Statement