Change travis-ci to github action
This commit is contained in:
parent
7e00b58db5
commit
e492260fe8
|
@ -18,6 +18,11 @@ jobs:
|
||||||
make eunit
|
make eunit
|
||||||
make ct
|
make ct
|
||||||
make cover
|
make cover
|
||||||
|
- name: Coveralls
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
run: |
|
||||||
|
make coveralls
|
||||||
- uses: actions/upload-artifact@v1
|
- uses: actions/upload-artifact@v1
|
||||||
if: always()
|
if: always()
|
||||||
with:
|
with:
|
||||||
|
@ -26,4 +31,4 @@ jobs:
|
||||||
- uses: actions/upload-artifact@v1
|
- uses: actions/upload-artifact@v1
|
||||||
with:
|
with:
|
||||||
name: cover
|
name: cover
|
||||||
path: _build/test/cover
|
path: _build/test/cover
|
||||||
|
|
24
.travis.yml
24
.travis.yml
|
@ -1,24 +0,0 @@
|
||||||
language: erlang
|
|
||||||
|
|
||||||
otp_release:
|
|
||||||
- 22.1
|
|
||||||
|
|
||||||
before_install:
|
|
||||||
- git clone https://github.com/erlang/rebar3.git; cd rebar3; ./bootstrap; sudo mv rebar3 /usr/local/bin/; cd ..
|
|
||||||
|
|
||||||
script:
|
|
||||||
- make compile
|
|
||||||
- rm -rf rebar.lock
|
|
||||||
- make xref
|
|
||||||
- rm -rf rebar.lock
|
|
||||||
- make eunit
|
|
||||||
- rm -rf rebar.lock
|
|
||||||
- make ct
|
|
||||||
- rm -rf rebar.lock
|
|
||||||
- make cover
|
|
||||||
- rm -rf rebar.lock
|
|
||||||
|
|
||||||
after_success:
|
|
||||||
- make coveralls
|
|
||||||
|
|
||||||
sudo: false
|
|
2
Makefile
2
Makefile
|
@ -65,7 +65,7 @@ cover:
|
||||||
|
|
||||||
.PHONY: coveralls
|
.PHONY: coveralls
|
||||||
coveralls:
|
coveralls:
|
||||||
@rebar3 coveralls send
|
@rebar3 as test coveralls send
|
||||||
|
|
||||||
.PHONY: xref
|
.PHONY: xref
|
||||||
xref:
|
xref:
|
||||||
|
|
|
@ -31,13 +31,12 @@
|
||||||
{cover_opts, [verbose]}.
|
{cover_opts, [verbose]}.
|
||||||
{cover_export_enabled, true}.
|
{cover_export_enabled, true}.
|
||||||
|
|
||||||
{plugins, [coveralls]}.
|
|
||||||
|
|
||||||
{erl_first_files, ["src/emqx_logger.erl"]}.
|
{erl_first_files, ["src/emqx_logger.erl"]}.
|
||||||
|
|
||||||
{profiles,
|
{profiles,
|
||||||
[{test,
|
[{test,
|
||||||
[{deps,
|
[{plugins, [{coveralls, {git, "https://github.com/emqx/coveralls-erl", {branch, "github"}}}]},
|
||||||
|
{deps,
|
||||||
[{bbmustache, "1.7.0"},
|
[{bbmustache, "1.7.0"},
|
||||||
{emqtt, {git, "https://github.com/emqx/emqtt", {tag, "1.2.0"}}},
|
{emqtt, {git, "https://github.com/emqx/emqtt", {tag, "1.2.0"}}},
|
||||||
{emqx_ct_helpers, {git, "https://github.com/emqx/emqx-ct-helpers", {tag, "1.2.2"}}}
|
{emqx_ct_helpers, {git, "https://github.com/emqx/emqx-ct-helpers", {tag, "1.2.2"}}}
|
||||||
|
|
|
@ -1,11 +1,20 @@
|
||||||
CONFIG1 = case os:getenv("TRAVIS") of
|
%% -*-: erlang -*-
|
||||||
"true" ->
|
|
||||||
JobId = os:getenv("TRAVIS_JOB_ID"),
|
|
||||||
[{coveralls_service_job_id, JobId},
|
|
||||||
{coveralls_coverdata, "_build/test/cover/*.coverdata"},
|
|
||||||
{coveralls_service_name , "travis-ci"} | CONFIG];
|
|
||||||
_ ->
|
|
||||||
CONFIG
|
|
||||||
end,
|
|
||||||
|
|
||||||
CONFIG1.
|
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")},
|
||||||
|
{coveralls_coverdata, "_build/test/cover/*.coverdata"},
|
||||||
|
{coveralls_service_name, "github"} | 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];
|
||||||
|
_ ->
|
||||||
|
CONFIG1
|
||||||
|
end;
|
||||||
|
_ ->
|
||||||
|
CONFIG
|
||||||
|
end.
|
||||||
|
|
Loading…
Reference in New Issue