Skip to content

Commit

Permalink
chore: add dialyzer to pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
yordis committed Jan 8, 2023
1 parent 5eda4dc commit b6e6071
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 6 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ jobs:

- name: Setup Elixir and Erlang versions
uses: erlef/setup-beam@v1
id: beam
with:
otp-version: ${{ env.OTP_VERSION }}
elixir-version: ${{ env.ELIXIR_VERSION }}
Expand Down Expand Up @@ -75,6 +76,24 @@ jobs:
- name: Credo
run: mix credo

- name: Restore PLT cache
uses: actions/cache@v3
id: plt_cache
with:
key: |
${{ runner.os }}-${{ steps.beam.outputs.elixir-version }}-${{ steps.beam.outputs.otp-version }}-plt
restore-keys: |
${{ runner.os }}-${{ steps.beam.outputs.elixir-version }}-${{ steps.beam.outputs.otp-version }}-plt
path: |
priv/plts
- name: Create Dialyzer PLTs
if: steps.plt_cache.outputs.cache-hit != 'true'
run: mix dialyzer --plt

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

publish-hex-package:
name: Publish Hex Package ⬆️☁️
runs-on: ubuntu-20.04
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ erl_crash.dump
# Ignore package tarball (built via "mix hex.build").
spear-*.tar


# Temporary files for e.g. tests
/tmp

/priv/plts/*.plt
/priv/plts/*.plt.hash
4 changes: 2 additions & 2 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
elixir 1.12.3-otp-24
erlang 24.0
elixir 1.14.2-otp-25
erlang 25.2
2 changes: 1 addition & 1 deletion lib/spear.ex
Original file line number Diff line number Diff line change
Expand Up @@ -1993,7 +1993,7 @@ defmodule Spear do
stream_name :: String.t() | :all,
group_name :: String.t(),
opts :: Keyword.t()
) :: {:ok, Spear.PersistentSubcription.Info.t()} | {:error, any()}
) :: {:ok, Spear.PersistentSubscription.Info.t()} | {:error, any()}
def get_persistent_subscription_info(conn, stream_name, group_name, opts \\ [])
when (is_binary(stream_name) or stream_name == :all) and is_binary(group_name) do
get_info_message =
Expand Down
7 changes: 7 additions & 0 deletions lib/spear/connection/response.ex
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,12 @@ defmodule Spear.Connection.Response do

# a slim data structure for storing information about an HTTP/2 response

@type t :: %__MODULE__{
status: any,
type: any,
headers: any,
data: any
}

defstruct [:status, :type, headers: [], data: <<>>]
end
11 changes: 9 additions & 2 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,20 @@ defmodule Spear.MixProject do
inch: :dev,
bless: :test,
test: :test,
dialyzer: :test

# NOTE: do we really need this? I have to fix fixing some issues related to
# dialyzer and compilation based on System.get_env("EVENTSTORE_VERSION") call
# dialyzer: :test
],
name: "Spear",
source_url: @source_url,
deps: deps(),
docs: docs(),
package: package(),
description: description()
description: description(),
dialyzer: [
plt_file: {:no_warn, "priv/plts/dialyzer.plt"}
]
]
end

Expand All @@ -54,6 +60,7 @@ defmodule Spear.MixProject do
# dev/test utilities
{:castore, ">= 0.0.0", only: [:dev, :test]},
{:ex_doc, "~> 0.24", only: :dev, runtime: false},
{:dialyxir, ">= 0.0.0", only: [:dev, :test], runtime: false},
# testing suite
{:credo, "~> 1.5", only: :test},
{:bless, "~> 1.0", only: :test},
Expand Down
2 changes: 2 additions & 0 deletions mix.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
"certifi": {:hex, :certifi, "2.6.1", "dbab8e5e155a0763eea978c913ca280a6b544bfa115633fa20249c3d396d9493", [:rebar3], [], "hexpm", "524c97b4991b3849dd5c17a631223896272c6b0af446778ba4675a1dff53bb7e"},
"connection": {:hex, :connection, "1.1.0", "ff2a49c4b75b6fb3e674bfc5536451607270aac754ffd1bdfe175abe4a6d7a68", [:mix], [], "hexpm", "722c1eb0a418fbe91ba7bd59a47e28008a189d47e37e0e7bb85585a016b2869c"},
"credo": {:hex, :credo, "1.5.6", "e04cc0fdc236fefbb578e0c04bd01a471081616e741d386909e527ac146016c6", [:mix], [{:bunt, "~> 0.2.0", [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", "4b52a3e558bd64e30de62a648518a5ea2b6e3e5d2b164ef5296244753fc7eb17"},
"dialyxir": {:hex, :dialyxir, "1.2.0", "58344b3e87c2e7095304c81a9ae65cb68b613e28340690dfe1a5597fd08dec37", [:mix], [{:erlex, ">= 0.2.6", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "61072136427a851674cab81762be4dbeae7679f85b1272b6d25c3a839aff8463"},
"earmark_parser": {:hex, :earmark_parser, "1.4.29", "149d50dcb3a93d9f3d6f3ecf18c918fb5a2d3c001b5d3305c926cddfbd33355b", [:mix], [], "hexpm", "4902af1b3eb139016aed210888748db8070b8125c2342ce3dcae4f38dcc63503"},
"erlex": {:hex, :erlex, "0.2.6", "c7987d15e899c7a2f34f5420d2a2ea0d659682c06ac607572df55a43753aa12e", [:mix], [], "hexpm", "2ed2e25711feb44d52b17d2780eabf998452f6efda104877a3881c2f8c0c0c75"},
"event_store_db_gpb_protobufs": {:hex, :event_store_db_gpb_protobufs, "2.2.0", "fca2bdeac5fca205e02d3cb9f170477a5422e147413d21d07c19e1ffc70e66aa", [:rebar3], [{:gpb, "~> 4.0", [hex: :gpb, repo: "hexpm", optional: false]}], "hexpm", "dad49149eb6913805277a698ec1f607aac945c40cbf427aa03cc97309fdf2f1f"},
"ex_doc": {:hex, :ex_doc, "0.29.0", "4a1cb903ce746aceef9c1f9ae8a6c12b742a5461e6959b9d3b24d813ffbea146", [:mix], [{:earmark_parser, "~> 1.4.19", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_elixir, "~> 0.14", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1", [hex: :makeup_erlang, repo: "hexpm", optional: false]}], "hexpm", "f096adb8bbca677d35d278223361c7792d496b3fc0d0224c9d4bc2f651af5db1"},
"excoveralls": {:hex, :excoveralls, "0.14.1", "14140e4ef343f2af2de33d35268c77bc7983d7824cb945e6c2af54235bc2e61f", [:mix], [{:hackney, "~> 1.16", [hex: :hackney, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "4a588f9f8cf9dc140cc1f3d0ea4d849b2f76d5d8bee66b73c304bb3d3689c8b0"},
Expand Down
Empty file added priv/plts/.gitkeep
Empty file.

0 comments on commit b6e6071

Please sign in to comment.