forked from kafka4beam/brod
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rebar.config.script
22 lines (22 loc) · 1.13 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
Plugins =
case erlang:list_to_integer(erlang:system_info(otp_release)) of
Version when Version > 23 ->
ExtraPlugins = [{rebar3_ex_doc, "~> 0.2.9"},{rebar3_hex, "~> 7.0.1"}],
{project_plugins, lists:merge(ExtraPlugins, proplists:get_value(project_plugins, CONFIG))};
_ -> {project_plugins, proplists:get_value(project_plugins, CONFIG)}
end,
CoverallsConfigs = case {os:getenv("GITHUB_ACTIONS"), os:getenv("GITHUB_TOKEN")} of
{"true", Token} when is_list(Token) ->
Configs = [{coveralls_repo_token, Token},
{coveralls_coverdata, "_build/test/cover/*.coverdata"},
{coveralls_service_job_id, os:getenv("GITHUB_RUN_ID")},
{coveralls_commit_sha, os:getenv("GITHUB_SHA")},
{coveralls_service_name, "github"},
{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} | Configs];
_ -> Configs
end;
_ -> []
end,
[Plugins | lists:merge(CoverallsConfigs, CONFIG)].