ci: build dialyzer PLT with quicer, jq and bcrypt

This commit is contained in:
William Yang 2023-01-12 14:58:45 +01:00
parent 9e9ae50ab9
commit 282d1a6829
2 changed files with 28 additions and 12 deletions

View File

@ -26,6 +26,19 @@ end,
Bcrypt = {bcrypt, {git, "https://github.com/emqx/erlang-bcrypt.git", {tag, "0.6.0"}}},
Quicer = {quicer, {git, "https://github.com/emqx/quic.git", {tag, "0.0.104"}}}.
Dialyzer = fun(Config) ->
{dialyzer, OldDialyzerConfig} = lists:keyfind(dialyzer, 1, Config),
{plt_extra_apps, OldExtra} = lists:keyfind(plt_extra_apps, 1, OldDialyzerConfig),
Extra = OldExtra ++ [quicer || IsQuicSupp()],
NewDialyzerConfig = [{plt_extra_apps, Extra} | OldDialyzerConfig],
lists:keystore(
dialyzer,
1,
Config,
{dialyzer, NewDialyzerConfig}
)
end.
ExtraDeps = fun(C) ->
{deps, Deps0} = lists:keyfind(deps, 1, C),
{erl_opts, ErlOpts0} = lists:keyfind(erl_opts, 1, C),
@ -43,4 +56,4 @@ ExtraDeps = fun(C) ->
)
end,
ExtraDeps(CONFIG).
Dialyzer(ExtraDeps(CONFIG)).

View File

@ -548,17 +548,20 @@ dialyzer(Config) ->
AppsToExclude = AppNames -- KnownApps,
case length(AppsToAnalyse) > 0 of
true ->
lists:keystore(
dialyzer,
1,
Config,
{dialyzer, OldDialyzerConfig ++ [{exclude_apps, AppsToExclude}]}
);
false ->
Config
end.
Extra =
[bcrypt || provide_bcrypt_dep()] ++
[jq || is_jq_supported()] ++
[quicer || is_quicer_supported()],
NewDialyzerConfig =
OldDialyzerConfig ++
[{exclude_apps, AppsToExclude} || length(AppsToAnalyse) > 0] ++
[{plt_extra_apps, Extra} || length(Extra) > 0],
lists:keystore(
dialyzer,
1,
Config,
{dialyzer, NewDialyzerConfig}
).
coveralls() ->
case {os:getenv("GITHUB_ACTIONS"), os:getenv("GITHUB_TOKEN")} of