Skip to content

Commit 4ef2fbc

Browse files
committed
Fix compatibility with OTP 26
1 parent 82560f5 commit 4ef2fbc

File tree

5 files changed

+24
-18
lines changed

5 files changed

+24
-18
lines changed

.github/workflows/ci.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,27 +17,36 @@ jobs:
1717
fail-fast: false
1818
matrix:
1919
include:
20-
- otp: '25.x'
20+
- otp: '26.x'
2121
os: 'ubuntu-latest'
22+
rebar3_version: "3.23.0"
2223
coverage: true
2324
xref: true
2425
dialyzer: true
26+
- otp: '25.x'
27+
os: 'ubuntu-latest'
28+
rebar3_version: "3.23.0"
2529
- otp: '24.x'
2630
os: 'ubuntu-latest'
31+
rebar3_version: "3.23.0"
2732
- otp: '23.x'
2833
os: 'ubuntu-20.04'
34+
rebar3_version: "3.20.0"
2935

3036
env:
3137
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3238
OTP_VERSION: ${{ matrix.otp }}
39+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
3340

3441
steps:
35-
- uses: actions/checkout@v3
42+
- uses: actions/checkout@v4
3643

3744
- name: Install OTP and Elixir
3845
uses: erlef/setup-beam@v1
3946
with:
4047
otp-version: ${{ matrix.otp }}
48+
rebar3-version: ${{ matrix.rebar3_version }}
49+
version-type: loose
4150

4251
- name: Cache deps
4352
uses: actions/cache@v3
@@ -82,7 +91,7 @@ jobs:
8291
if: ${{ matrix.dialyzer && steps.plt-cache.outputs.cache-hit != 'true' }}
8392

8493
- name: Upload coverage to Codecov
85-
uses: codecov/codecov-action@v3
94+
uses: codecov/codecov-action@v4
8695
with:
8796
file: _build/test/covertool/shards.covertool.xml
8897
flags: otp-${{ matrix.otp }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,4 @@ doc
3535
docs
3636
/priv/plts
3737
/bench
38+
rebar3

.tool-versions

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
erlang 26.2

src/shards.erl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -970,6 +970,15 @@ maybe_register(Name, Pid, Options) ->
970970
ok
971971
end.
972972

973+
-ifndef(OTP_RELEASE).
974+
%% OTP 20 or lower.
975+
-define(OTP_RELEASE, 20).
976+
-endif.
977+
978+
-if(?OTP_RELEASE >= 26).
979+
%% @private
980+
wrap_exit() -> ok.
981+
-else.
973982
%% @private
974983
wrap_exit() ->
975984
% We wait for the 'EXIT' signal from the partition supervisor knowing
@@ -978,6 +987,7 @@ wrap_exit() ->
978987
receive
979988
{'EXIT', _Pid, _Reason} -> ok
980989
end.
990+
-endif.
981991

982992
%% @equiv next(Tab, Key1, shards_meta:get(Tab))
983993
next(Tab, Key1) ->

test/shards_SUITE.erl

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -40,21 +40,6 @@
4040
t_table_creation_errors/1
4141
]).
4242

43-
% %% Test Cases Helpers
44-
% -export([
45-
% t_basic_ops_/1,
46-
% t_match_ops_/1,
47-
% t_select_ops_/1
48-
% ]).
49-
50-
% %% Helpers
51-
% -export([
52-
% init_shards/0,
53-
% init_shards/1,
54-
% cleanup_shards/0,
55-
% delete_shards/0
56-
% ]).
57-
5843
-define(EXCLUDED_FUNS, [
5944
module_info,
6045
all,

0 commit comments

Comments
 (0)