Skip to content

Commit

Permalink
restoring dialyzer
Browse files Browse the repository at this point in the history
  • Loading branch information
cblavier committed Nov 7, 2023
1 parent ee8df4e commit b1e3c21
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 10 deletions.
36 changes: 31 additions & 5 deletions .github/workflows/elixir.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:

- name: Set up Elixir
uses: erlef/setup-beam@v1
id: beam
with:
otp-version: "26.0.2"
elixir-version: "1.15.5-otp-26"
Expand All @@ -33,22 +34,47 @@ jobs:
key: ${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }}
restore-keys: ${{ runner.os }}-mix-

- name: Restore PLT cache
id: plt_cache
uses: actions/cache/restore@v3
with:
key: |
plt-${{ runner.os }}-${{ steps.beam.outputs.otp-version }}-${{ steps.beam.outputs.elixir-version }}-${{ hashFiles('**/mix.lock') }}
restore-keys: |
plt-${{ runner.os }}-${{ steps.beam.outputs.otp-version }}-${{ steps.beam.outputs.elixir-version }}-
path: |
.plts/
- name: Install dependencies
run: |
mix deps.get
mix dialyzer —-plt --ignore-exit-status
run: mix deps.get

- name: Compilation
run: mix compile --warnings-as-errors

- name: Create PLTs
if: steps.plt_cache.outputs.cache-hit != 'true'
run: mix dialyzer --plt

# By default, the GitHub Cache action will only save the cache if all steps in the job succeed,
# so we separate the cache restore and save steps in case running dialyzer fails.
- name: Save PLT cache
id: plt_cache_save
uses: actions/cache/save@v3
if: steps.plt_cache.outputs.cache-hit != 'true'
with:
key: |
plt-${{ runner.os }}-${{ steps.beam.outputs.otp-version }}-${{ steps.beam.outputs.elixir-version }}-${{ hashFiles('**/mix.lock') }}
path: |
.plts
- name: Check formatting
run: mix format --check-formatted

- name: Credo
run: mix credo

# - name: Dialyzer
# run: mix dialyzer --no-check
- name: Dialyzer
run: mix dialyzer --format github

- name: Run tests
run: mix coveralls.json
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,4 @@ phoenix_storybook-*.tar
.vscode
.tool-versions
.plts
.elixir_ls
7 changes: 2 additions & 5 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ defmodule PhoenixStorybook.MixProject do
coverage: :test
],
dialyzer: [
plt_add_apps: [:mix, :jason, :earmark],
plt_add_apps: [:mix],
plt_local_path: ".plts",
plt_core_path: ".plts",
plt_file: {:no_warn, ".plts/storybook.plt"}
Expand All @@ -37,13 +37,10 @@ defmodule PhoenixStorybook.MixProject do
def application do
[
mod: {PhoenixStorybook.Application, []},
extra_applications: [:logger] ++ extra_applications(Mix.env())
extra_applications: [:logger]
]
end

defp extra_applications(env) when env in [:dev, :test], do: [:hex]
defp extra_applications(_), do: []

defp elixirc_paths(:test), do: ["lib", "test/fixtures"]
defp elixirc_paths(_), do: ["lib"]

Expand Down

0 comments on commit b1e3c21

Please sign in to comment.