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
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
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:
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
- #forms
- #api
- #metaprogramming
- #security
- #hex









