Skip to content

Commit 7308c09

Browse files
authored
Run Dialyzer in CI (#10)
1 parent 7fb1c12 commit 7308c09

File tree

1 file changed

+19
-5
lines changed

1 file changed

+19
-5
lines changed

.github/workflows/main.yml

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,19 +35,30 @@ jobs:
3535
elixir-version: ${{matrix.elixir}}
3636

3737
- name: Install dependencies
38-
run: mix deps.get --only test
38+
run: mix deps.get --only test, deps.compile
39+
40+
# Don't cache PLTs based on mix.lock hash, as Dialyzer can incrementally update even old ones
41+
# Cache key based on Elixir & Erlang version (also useful when running in matrix)
42+
- name: Cache Dialyzer's PLT
43+
uses: actions/cache@v2
44+
id: cache-plt
45+
with:
46+
path: priv/plts
47+
key: ${{ runner.os }}-otp${{ matrix.otp }}-elixir${{ matrix.elixir }}
48+
49+
# Create PLTs if no cache was found
50+
- name: Create PLTs
51+
if: steps.cache-plt.outputs.cache-hit != 'true'
52+
run: mix do deps.get, dialyzer --plt
3953

4054
- name: Check formatting
4155
run: mix format --check-formatted
4256
if: ${{matrix.lint}}
4357

4458
- name: Check for unused dependencies
45-
run: mix deps.get && mix deps.unlock --check-unused
59+
run: mix do deps.get, deps.unlock --check-unused
4660
if: ${{matrix.lint}}
4761

48-
- name: Compile dependencies
49-
run: mix deps.compile
50-
5162
- name: Compile with --warnings-as-errors
5263
run: mix compile --warnings-as-errors
5364
if: ${{matrix.lint}}
@@ -59,3 +70,6 @@ jobs:
5970
- name: Run tests with coverage
6071
run: mix coveralls.github --trace
6172
if: ${{matrix.coverage}}
73+
74+
- name: Run Dialyzer
75+
run: mix dialyzer

0 commit comments

Comments
 (0)