diff options
author | Badlop <badlop@process-one.net> | 2021-05-25 18:31:47 +0200 |
---|---|---|
committer | Badlop <badlop@process-one.net> | 2021-05-25 18:45:31 +0200 |
commit | 77ef03e1044cc1b960c7247cb4ccaa73ab9d707a (patch) | |
tree | 2d0cd5600e565e87118ba80a48a53c6a34288f11 /rebar.config | |
parent | Remove tests.yml github workflow, a new reworked one is coming (#3613) (diff) |
New ci.yml with all static and dynamic testing suites (#3613)
It supports all that was already in .travis.yml and tests.yml, plus:
- exclude paths that don't affect source code
- two very distinct scenarios, ancient a recent (OTP, Rebar, Ubuntu)
- cache binaries and dialyzer for small speedup and network usage
- separated results, to view comfortably where and what failed
- use coveralls example rebar3 code, instead of custom rebar2
- upload binaries.zip that can be used with Binary Installers
Diffstat (limited to '')
-rw-r--r-- | rebar.config | 2 | ||||
-rw-r--r-- | rebar.config.script | 35 |
2 files changed, 21 insertions, 16 deletions
diff --git a/rebar.config b/rebar.config index 1e3da2d7..649fd585 100644 --- a/rebar.config +++ b/rebar.config @@ -156,6 +156,8 @@ {cover_enabled, true}. {cover_export_enabled, true}. +{coveralls_coverdata, "_build/test/cover/ct.coverdata"}. +{coveralls_service_name, "github"}. {recursive_cmds, ['configure-deps']}. {overrides, [ diff --git a/rebar.config.script b/rebar.config.script index c65068fa..9591b9ea 100644 --- a/rebar.config.script +++ b/rebar.config.script @@ -339,17 +339,21 @@ fun(Deps, FDeps) -> end, Deps) end, -TravisPostHooks = -fun(true) -> - [{ct, "echo '\n%%! -pa ebin/ deps/coveralls/ebin\n" ++ - "main(_)->{ok,F}=file:open(\"erlang.json\",[write])," ++ - "io:fwrite(F,\"~s\",[coveralls:convert_file(" ++ - "\"logs/all.coverdata\", \"" ++ - os:getenv("TRAVIS_JOB_ID") ++ - "\", \"travis-ci\",\"\")]).' > getcover.erl"}, - {ct, "escript ./getcover.erl"}]; - (_) -> - [] +GithubConfig = 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, Rules = [ @@ -358,10 +362,8 @@ Rules = [ {compile, {asn, compile}}, {clean, {asn, clean}} ]}]), []}, - {[deps], os:getenv("TRAVIS") == "true", - AppendList([{coveralls, ".*", {git, "https://github.com/markusn/coveralls-erl", {tag, "v2.0.1"}}}]), []}, - {[post_hooks], [cover_enabled], os:getenv("TRAVIS") == "true", - AppendList2(TravisPostHooks), [], false}, + {[plugins], IsRebar3 and (os:getenv("GITHUB_ACTIONS") == "true"), + AppendList([coveralls]), []}, {[overrides], [post_hook_configure], SystemDeps == false, AppendList2(GenDepsConfigure), [], []}, {[ct_extra_params], [eunit_compile_opts], true, @@ -379,7 +381,8 @@ Rules = [ ], Config = [{plugin_dir, filename:join([filename:dirname(SCRIPT),"plugins"])}]++ -FilterConfig(ProcessVars(CONFIG, []), Rules), +FilterConfig(ProcessVars(CONFIG, []), Rules)++ +GithubConfig, %io:format("ejabberd configuration:~n ~p~n", [Config]), |