Skip to content

Commit

Permalink
Add OTP-24 to CI (#273)
Browse files Browse the repository at this point in the history
  • Loading branch information
seriyps authored Sep 21, 2021
1 parent c6c6fd8 commit d012840
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 12 deletions.
14 changes: 9 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,17 @@ on:
- master
jobs:
ci:
name: Run checks and tests over ${{matrix.otp_vsn}} and ${{matrix.os}}
name: Checks and tests on OTP-${{matrix.otp_vsn}}, ${{matrix.os}}, ${{matrix.profile}}
runs-on: ${{matrix.os}}

strategy:
matrix:
otp_vsn: [20.3, 21.3, 22.3, 23.1]
otp_vsn: [21.3, 22.3, 23.3, 24.0]
os: [ubuntu-latest]
profile: [test, ranch18, ranch20]
exclude:
- otp_vsn: 24.0 # ranch 1.7 does not work on OTP24+
profile: test

container:
image: erlang:${{matrix.otp_vsn}}
Expand All @@ -26,10 +30,10 @@ jobs:
- name: xref
run: make xref
- name: Test
run: make test
run: make test REBAR_PROFILE=${{ matrix.profile }}
- name: Proper
run: make proper
run: make proper REBAR_PROFILE=${{ matrix.profile }}
- name: Cover
run: make cover
run: make cover REBAR_PROFILE=${{ matrix.profile }}
- name: Dialyze
run: make dialyze
4 changes: 2 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ on:
- master
jobs:
ci:
name: Run checks and tests over ${{matrix.otp_vsn}} and ${{matrix.os}}
name: Build edocs ${{matrix.otp_vsn}} and ${{matrix.os}}
runs-on: ${{matrix.os}}

strategy:
matrix:
otp_vsn: [21.3, 22.3, 23.1]
otp_vsn: [21.3, 22.3, 23.3, 24.0]
os: [ubuntu-latest]

container:
Expand Down
8 changes: 5 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
MINIMAL_COVERAGE = 75

REBAR_PROFILE = test

compile:
@./rebar3 compile

Expand All @@ -8,13 +10,13 @@ clean:

test:
ERL_AFLAGS="-s ssl"
./rebar3 eunit -c
./rebar3 as $(REBAR_PROFILE) eunit -c

proper:
./rebar3 proper -c
./rebar3 as $(REBAR_PROFILE) proper -c

cover:
./rebar3 cover --verbose --min_coverage $(MINIMAL_COVERAGE)
./rebar3 as $(REBAR_PROFILE) cover --verbose --min_coverage $(MINIMAL_COVERAGE)

dialyze:
./rebar3 as dialyzer dialyzer
Expand Down
2 changes: 2 additions & 0 deletions rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@
]}
]}
]},
{ranch18,
[{deps, [{ranch, "1.8.0"}]}]},
{ranch20,
[{deps, [{ranch, "2.0.0"}]}]},
{test,
Expand Down
Binary file modified rebar3
Binary file not shown.
5 changes: 3 additions & 2 deletions src/gen_smtp_server_session.erl
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,8 @@ init([Ref, Transport, Socket, Module, Options]) ->
{ok, Banner, CallbackState} ->
Transport:send(Socket, ["220 ", Banner, "\r\n"]),
ok = Transport:setopts(Socket, [{active, once},
{packet, line}]),
{packet, line},
binary]),
{ok, #state{socket = Socket,
transport = Transport,
module = Module,
Expand Down Expand Up @@ -683,7 +684,7 @@ handle_request({<<"STARTTLS">>, <<>>}, #state{socket = Socket, module = Module,
case ranch_ssl:handshake(Socket, [{packet, line}, {mode, list}, {ssl_imp, new} | TlsOpts2], 5000) of %XXX: see smtp_socket:?SSL_LISTEN_OPTIONS
{ok, NewSocket} ->
?log(debug, "SSL negotiation sucessful~n"),
ranch_ssl:setopts(NewSocket, [{packet, line}]),
ranch_ssl:setopts(NewSocket, [{packet, line}, binary]),
{ok, State#state{socket = NewSocket, transport = ranch_ssl, envelope=undefined,
authdata=undefined, waitingauth=false, readmessage=false,
tls=true, callbackstate = Module:handle_STARTTLS(OldCallbackState)}};
Expand Down

0 comments on commit d012840

Please sign in to comment.