Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Dialyxir #4

Merged
merged 1 commit into from
Dec 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 33 additions & 2 deletions .github/workflows/elixir_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
env:
cache-name: cache-elixir-deps
with:
path: deps
path: elixir/deps
key: ${{ runner.os }}-mix-${{ env.cache-name }}-${{ hashFiles('elixir/mix.lock') }}
restore-keys: |
${{ runner.os }}-mix-${{ env.cache-name }}-
Expand All @@ -53,7 +53,7 @@ jobs:
env:
cache-name: cache-compiled-build
with:
path: _build
path: elixir/_build
key: ${{ runner.os }}-mix-${{ env.cache-name }}-${{ hashFiles('elixir/mix.lock') }}
restore-keys: |
${{ runner.os }}-mix-${{ env.cache-name }}-
Expand All @@ -68,6 +68,37 @@ jobs:
- name: Run Linter
run: mix lint.ci

- name: Restore PLT cache
id: plt_cache
uses: actions/cache/restore@v3
with:
key: |
plt-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('elixir/mix.lock') }}
restore-keys: |
plt-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-
path: |
elixir/priv/plts

# Create PLTs if no cache was found
- 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 }}-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('elixir/mix.lock') }}
path: |
elixir/priv/plts

- name: Run Dialyzer
run: mix dialyzer --format github

- name: Run Tests
run: mix coveralls.json

Expand Down
3 changes: 3 additions & 0 deletions elixir/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,6 @@ leet_code-*.tar

# Temporary files, for example, from tests.
/tmp/

/priv/plts/*.plt
/priv/plts/*.plt.hash
8 changes: 8 additions & 0 deletions elixir/mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ defmodule LeetCode.MixProject do
"coveralls.post": :test,
"coveralls.html": :test,
"coveralls.cobertura": :test
],
dialyzer: [
plt_add_apps: [
:ex_unit
],
plt_file: {:no_warn, "priv/plts/project.plt"},
list_unused_filters: true
]
]
end
Expand All @@ -31,6 +38,7 @@ defmodule LeetCode.MixProject do
defp deps do
[
{:credo, "1.7.0", only: [:dev, :test], runtime: false},
{:dialyxir, "1.4.2", only: [:dev, :test], runtime: false},
{:excoveralls, "0.18.0", only: :test}
]
end
Expand Down
2 changes: 2 additions & 0 deletions elixir/mix.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
%{
"bunt": {:hex, :bunt, "0.2.1", "e2d4792f7bc0ced7583ab54922808919518d0e57ee162901a16a1b6664ef3b14", [:mix], [], "hexpm", "a330bfb4245239787b15005e66ae6845c9cd524a288f0d141c148b02603777a5"},
"credo": {:hex, :credo, "1.7.0", "6119bee47272e85995598ee04f2ebbed3e947678dee048d10b5feca139435f75", [:mix], [{:bunt, "~> 0.2.1", [hex: :bunt, repo: "hexpm", optional: false]}, {:file_system, "~> 0.2.8", [hex: :file_system, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "6839fcf63d1f0d1c0f450abc8564a57c43d644077ab96f2934563e68b8a769d7"},
"dialyxir": {:hex, :dialyxir, "1.4.2", "764a6e8e7a354f0ba95d58418178d486065ead1f69ad89782817c296d0d746a5", [:mix], [{:erlex, ">= 0.2.6", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "516603d8067b2fd585319e4b13d3674ad4f314a5902ba8130cd97dc902ce6bbd"},
"erlex": {:hex, :erlex, "0.2.6", "c7987d15e899c7a2f34f5420d2a2ea0d659682c06ac607572df55a43753aa12e", [:mix], [], "hexpm", "2ed2e25711feb44d52b17d2780eabf998452f6efda104877a3881c2f8c0c0c75"},
"excoveralls": {:hex, :excoveralls, "0.18.0", "b92497e69465dc51bc37a6422226ee690ab437e4c06877e836f1c18daeb35da9", [:mix], [{:castore, "~> 1.0", [hex: :castore, repo: "hexpm", optional: true]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "1109bb911f3cb583401760be49c02cbbd16aed66ea9509fc5479335d284da60b"},
"file_system": {:hex, :file_system, "0.2.10", "fb082005a9cd1711c05b5248710f8826b02d7d1784e7c3451f9c1231d4fc162d", [:mix], [], "hexpm", "41195edbfb562a593726eda3b3e8b103a309b733ad25f3d642ba49696bf715dc"},
"jason": {:hex, :jason, "1.4.1", "af1504e35f629ddcdd6addb3513c3853991f694921b1b9368b0bd32beb9f1b63", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "fbb01ecdfd565b56261302f7e1fcc27c4fb8f32d56eab74db621fc154604a7a1"},
Expand Down
Loading