-
Notifications
You must be signed in to change notification settings - Fork 138
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove HiPE from dialyzer deps if not available
In Erlang 24 or later HiPE has been removed and the module that we depend on in it has been moved to dialyzer. So we remove HiPE from the dialyzer analysis if HiPE does not exist.
- Loading branch information
Showing
1 changed file
with
29 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,30 @@ | ||
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")} | CONFIG], | ||
case os:getenv("GITHUB_EVENT_NAME") =:= "pull_request" | ||
andalso string:tokens(os:getenv("GITHUB_REF"), "/") of | ||
[_, "pull", PRNO, _] -> | ||
[{coveralls_service_pull_request, PRNO} | CONFIG1]; | ||
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; | ||
_ -> | ||
CONFIG1 | ||
end; | ||
_ -> | ||
CONFIG | ||
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. |