Skip to content

Commit

Permalink
chore: upgrade CI to elixir 1.15 and otp 26.1
Browse files Browse the repository at this point in the history
Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
  • Loading branch information
yordis committed Apr 18, 2024
1 parent 40966e5 commit b96d822
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 12 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ jobs:
- name: Set up Elixir
uses: erlef/setup-beam@v1
with:
elixir-version: '1.13'
otp-version: '24.3'
version-file: .tool-versions
version-type: strict
- name: Restore dependencies cache
uses: actions/cache@v4
with:
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ jobs:
strategy:
matrix:
elixir:
- 1.14
- 1.13
- 1.16
- 1.15
otp:
- 26.2
- 25.3
- 24.3
steps:
- uses: actions/checkout@v4
- name: Set up Elixir
Expand Down Expand Up @@ -83,8 +83,8 @@ jobs:
- name: Set up Elixir
uses: erlef/setup-beam@v1
with:
elixir-version: '1.13'
otp-version: '24.3'
elixir-version: '1.15'
otp-version: '26.1'
version-type: strict
- name: Restore dependencies cache
uses: actions/cache@v4
Expand Down
2 changes: 2 additions & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
elixir 1.16.2
erlang 26.2.3
2 changes: 1 addition & 1 deletion lib/tesla/adapter/hackney.ex
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ if Code.ensure_loaded?(:hackney) do
end

defp request(method, url, headers, body, opts) do
handle(:hackney.request(method, url, headers, body || '', opts), opts)
handle(:hackney.request(method, url, headers, body || ~c"", opts), opts)
end

defp request_stream(method, url, headers, body, opts) do
Expand Down
4 changes: 2 additions & 2 deletions lib/tesla/adapter/httpc.ex
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ defmodule Tesla.Adapter.Httpc do
headers = for {key, value} <- headers, do: {to_charlist(key), to_charlist(value)}

{content_type, headers} =
case List.keytake(headers, 'content-type', 0) do
nil -> {'text/plain', headers}
case List.keytake(headers, ~c"content-type", 0) do
nil -> {~c"text/plain", headers}
{{_, ct}, headers} -> {ct, headers}
end

Expand Down
24 changes: 24 additions & 0 deletions test/support/test_support.ex
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,28 @@ defmodule TestSupport do
|> Enum.map_join("|", fn {key, value} -> "#{key}: #{value}" end)
|> :zlib.gzip()
end

def ssl_opts(opts) do
Keyword.put_new(
opts,
:cacertfile,
Path.join([to_string(:code.priv_dir(:httparrot)), "/ssl/server-ca.crt"])
)
end

# case String.to_integer(System.otp_release()) do
# n when n >= 25 ->
# def ssl_opts(opts) do
# Keyword.put_new(opts, :cacerts, :public_key.cacerts_get())
# end

# _ ->
# def ssl_opts(opts) do
# Keyword.put_new(
# opts,
# :cacertfile,
# Path.join([to_string(:code.priv_dir(:httparrot)), "/ssl/server-ca.crt"])
# )
# end
# end
end
4 changes: 2 additions & 2 deletions test/tesla/middleware/timeout_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ defmodule Tesla.Middleware.TimeoutTest do
[{last_module, _, _, file_info} | _] = __STACKTRACE__

assert Tesla.Middleware.TimeoutTest.Client == last_module
assert file_info[:file] == 'lib/tesla/builder.ex'
assert file_info[:file] == ~c"lib/tesla/builder.ex"
assert file_info[:line] == 23
else
_ ->
Expand All @@ -131,7 +131,7 @@ defmodule Tesla.Middleware.TimeoutTest do
[_, {timeout_module, _, _, module_file_info} | _] = __STACKTRACE__

assert Tesla.Middleware.Timeout == timeout_module
assert module_file_info == [file: 'lib/tesla/middleware/timeout.ex', line: 59]
assert module_file_info == [file: ~c"lib/tesla/middleware/timeout.ex", line: 59]
else
_ ->
flunk("Expected exception to be thrown")
Expand Down

0 comments on commit b96d822

Please sign in to comment.