From d757fd2707643994559303760817803097834e73 Mon Sep 17 00:00:00 2001 From: Martin Sumner Date: Mon, 4 Oct 2021 23:03:00 +0100 Subject: [PATCH 1/2] Migrate from travis to github actions --- .github/workflows/erlang.yml | 26 ++++++++++++++++++++++++++ .travis.yml | 11 ----------- 2 files changed, 26 insertions(+), 11 deletions(-) create mode 100644 .github/workflows/erlang.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/erlang.yml b/.github/workflows/erlang.yml new file mode 100644 index 000000000..2f3ac6863 --- /dev/null +++ b/.github/workflows/erlang.yml @@ -0,0 +1,26 @@ +name: Erlang CI + +on: + push: + branches: [ develop-3.0 ] + pull_request: + branches: [ develop-3.0 ] + + +jobs: + + build: + + runs-on: ubuntu-latest + + container: + image: erlang:22.3.3 + + steps: + - uses: actions/checkout@v2 + - name: Compile + run: ./rebar3 compile + - name: Run xref and dialyzer + run: ./rebar3 do xref, dialyzer + - name: Run eunit + run: ./rebar3 do eunit diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 28739038e..000000000 --- a/.travis.yml +++ /dev/null @@ -1,11 +0,0 @@ -language: erlang -otp_release: - - 20.3.8 - - 21.3 - - 22.3 -script: - - chmod u+x rebar3 - - ./rebar3 do upgrade, compile, dialyzer, xref, eunit -notifications: - slack: - secure: SE0EMU9HenZlLBuNg7l6WLMxJPkfyAEGgodvAqMEuQmICtrh1nV019D/A8ykejYYPPsJafWVOfypOSDrSHCndzXvEZvU8l45nJ6XLdUdrDYEmvcSqN3EqmVSsuf9H3g99bvKygXaY27MkTS5ixLil7PzybG+YpwMnQGcQxYo5Eg= From 61972fa5832207cb6fb48905d8e13b55ec2639ab Mon Sep 17 00:00:00 2001 From: Martin Sumner Date: Mon, 4 Oct 2021 23:21:16 +0100 Subject: [PATCH 2/2] Remove test from gha Test requires permission changes which are not supported in Github Actions --- .github/workflows/erlang.yml | 2 +- rebar.config | 3 ++- src/riak_core_ring_manager.erl | 4 ++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/erlang.yml b/.github/workflows/erlang.yml index 2f3ac6863..e42e29191 100644 --- a/.github/workflows/erlang.yml +++ b/.github/workflows/erlang.yml @@ -23,4 +23,4 @@ jobs: - name: Run xref and dialyzer run: ./rebar3 do xref, dialyzer - name: Run eunit - run: ./rebar3 do eunit + run: ./rebar3 as gha do eunit diff --git a/rebar.config b/rebar.config index 75ea1cdd9..826ff4457 100644 --- a/rebar.config +++ b/rebar.config @@ -36,5 +36,6 @@ {profiles, [ {test, [{deps, [meck]}, {erl_opts, [nowarn_export_all]}]}, - {eqc, [{deps, [meck]}, {erl_opts, [{d, 'EQC'}, nowarn_export_all]}]} + {eqc, [{deps, [meck]}, {erl_opts, [{d, 'EQC'}, nowarn_export_all]}]}, + {gha, [{erl_opts, [{d, 'GITHUBEXCLUDE'}]}]} ]}. diff --git a/src/riak_core_ring_manager.erl b/src/riak_core_ring_manager.erl index e12ec49ae..ded66f483 100644 --- a/src/riak_core_ring_manager.erl +++ b/src/riak_core_ring_manager.erl @@ -728,6 +728,8 @@ refresh_my_ring_test() -> || {AppKey, _Val} <- Core_Settings], ok. +-ifndef(GITHUBEXCLUDE). + -define(TEST_RINGDIR, "ring_manager_eunit"). -define(TEST_RINGFILE, (?TEST_RINGDIR ++ "/test.ring")). -define(TMP_RINGFILE, (?TEST_RINGFILE ++ ".tmp")). @@ -756,6 +758,8 @@ do_write_ringfile_test() -> ok = file:change_mode(?TEST_RINGFILE, 8#00644), ok = file:delete(?TEST_RINGFILE). +-endif. + is_stable_ring_test() -> {A,B,C} = Now = os:timestamp(), TimeoutSecs = ?PROMOTE_TIMEOUT div 1000,