-
Notifications
You must be signed in to change notification settings - Fork 137
/
rebar.config.script
30 lines (30 loc) · 1.31 KB
/
rebar.config.script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
CoverallsConfig =
case {os:getenv("GITHUB_ACTIONS"), os:getenv("GITHUB_TOKEN")} of
{"true", Token} when is_list(Token) ->
CONFIG1 = [{coveralls_repo_token, Token},
{coveralls_service_job_id, os:getenv("GITHUB_RUN_ID")},
{coveralls_commit_sha, os:getenv("GITHUB_SHA")},
{coveralls_service_number, os:getenv("GITHUB_RUN_NUMBER")}],
case os:getenv("GITHUB_EVENT_NAME") =:= "pull_request"
andalso string:tokens(os:getenv("GITHUB_REF"), "/") of
[_, "pull", PRNO, _] ->
[{coveralls_service_pull_request, PRNO} | CONFIG1];
_ ->
CONFIG1
end;
_ ->
[]
end,
%% Remove HiPE from dialyzer on versions of Erlang that does not support it
DiaConfig =
case application:load(hipe) of
{error,_} ->
{dialyzer,DiaOpts} = lists:keyfind(dialyzer, 1, CONFIG),
{plt_extra_apps,Extra} = lists:keyfind(plt_extra_apps, 1, DiaOpts),
NewDiaOpts = lists:keyreplace(plt_extra_apps, 1, DiaOpts,
{plt_extra_apps, lists:delete(hipe, Extra)}),
lists:keyreplace(dialyzer, 1, CONFIG, {dialyzer, NewDiaOpts});
_ ->
CONFIG
end,
DiaConfig ++ CoverallsConfig.