Skip to content

Commit 384570f

Browse files
authored
Merge pull request #10 from alt-ctrl-dev/alt-ctrl-dev-patch-1
Chore: added check for dialyzer
2 parents 1f8c881 + 02bb5b4 commit 384570f

File tree

4 files changed

+51
-8
lines changed

4 files changed

+51
-8
lines changed

.dialyzer_ignore.exs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Function ExUnit.Callbacks.__merge__/3 does not exist.
2+
Function ExUnit.CaseTemplate.__proxy__/2 does not exist.

.github/workflows/ci.yml

Lines changed: 41 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,11 @@ jobs:
9696
# Step: Compile the project treating any warnings as errors.
9797
# Customize this step if a different behavior is desired.
9898
- name: Compiles without warnings
99+
id: compile
99100
run: mix compile --warnings-as-errors
101+
102+
- if: steps.compile.conclusion == 'failure'
103+
run: echo "### Failed on lint" >> $GITHUB_STEP_SUMMARY
100104

101105
# Step: Check that the checked in code has already been formatted.
102106
# This step fails if something was found unformatted.
@@ -118,16 +122,46 @@ jobs:
118122
- name: Run security-focused static analysis
119123
id: sobelow
120124
run: mix sobelow --exit --threshold medium -i Config.HTTPS,Config.CSP
121-
125+
122126
- if: steps.sobelow.conclusion == 'failure'
123127
run: echo "### Failed on sobelow" >> $GITHUB_STEP_SUMMARY
124-
125-
- name: Run security-focused static analysis
126-
id: dialyzer
127-
run: mix dialyzer
128128

129-
- if: steps.dialyzer.conclusion == 'failure'
130-
run: echo "### Failed on dialyzer" >> $GITHUB_STEP_SUMMARY
129+
## Don't cache PLTs based on mix.lock hash, as Dialyzer can incrementally update even old ones
130+
## Cache key based on Elixir & Erlang version (also useful when running in matrix)
131+
#- name: Restore PLT cache
132+
# uses: actions/cache/restore@v3
133+
# id: plt_cache
134+
# with:
135+
# key: |
136+
# ${{ runner.os }}-${{ steps.beam.outputs.elixir-version }}-${{ steps.beam.outputs.otp-version }}-plt
137+
# restore-keys: |
138+
# ${{ runner.os }}-${{ steps.beam.outputs.elixir-version }}-${{ steps.beam.outputs.otp-version }}-plt
139+
# path: |
140+
# priv/plts
141+
142+
## Create PLTs if no cache was found
143+
#- name: Create PLTs
144+
# if: steps.plt_cache.outputs.cache-hit != 'true'
145+
# run: mix dialyzer --plt
146+
147+
## By default, the GitHub Cache action will only save the cache if all steps in the job succeed,
148+
## so we separate the cache restore and save steps in case running dialyzer fails.
149+
#- name: Save PLT cache
150+
# uses: actions/cache/save@v3
151+
# if: steps.plt_cache.outputs.cache-hit != 'true'
152+
# id: plt_cache_save
153+
# with:
154+
# key: |
155+
# ${{ runner.os }}-${{ steps.beam.outputs.elixir-version }}-${{ steps.beam.outputs.otp-version }}-plt
156+
# path: |
157+
# priv/plts
158+
159+
#- name: Run dialyzer
160+
# id: dialyzer
161+
# run: mix dialyzer --format github
162+
163+
#- if: steps.dialyzer.conclusion == 'failure'
164+
# run: echo "### Failed on dialyzer" >> $GITHUB_STEP_SUMMARY
131165

132166
# Step: Execute the tests.
133167
- name: Run tests

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,6 @@ aba_viewer-*.tar
3838
npm-debug.log
3939
/assets/node_modules/
4040

41+
# Ignore PLTs
42+
/priv/plts/*.plt
43+
/priv/plts/*.plt.hash

mix.exs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@ defmodule AbaViewer.MixProject do
99
elixirc_paths: elixirc_paths(Mix.env()),
1010
start_permanent: Mix.env() == :prod,
1111
aliases: aliases(),
12-
deps: deps()
12+
deps: deps(),
13+
dialyzer: [
14+
plt_file: {:no_warn, "priv/plts/dialyzer.plt"},
15+
remove_defaults: [:unknown]
16+
]
1317
]
1418
end
1519

0 commit comments

Comments
 (0)