Skip to content

Commit d09c601

Browse files
authored
Update Elixir/Erlang versions in CI (#407)
1 parent 39b0516 commit d09c601

File tree

18 files changed

+108
-79
lines changed

18 files changed

+108
-79
lines changed

.github/workflows/main.yml

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ jobs:
1414
fail-fast: false
1515
matrix:
1616
include:
17-
- erlang: "25.2"
18-
elixir: "1.14"
17+
- erlang: "26.0.2"
18+
elixir: "1.15"
1919
lint: true
2020
coverage: true
2121
dialyzer: true
@@ -47,7 +47,10 @@ jobs:
4747
path: |
4848
deps
4949
_build
50-
key: ${{ runner.os }}-mix-otp${{ matrix.erlang }}-elixir${{ matrix.elixir }}-${{ hashFiles('**/mix.lock') }}
50+
key: |
51+
${{ runner.os }}-mix-otp${{ matrix.erlang }}-elixir${{ matrix.elixir }}-${{ hashFiles('**/mix.lock') }}
52+
restore-keys: |
53+
${{ runner.os }}-mix-otp${{ matrix.erlang }}-elixir${{ matrix.elixir }}-
5154
5255
- name: Install and compile dependencies
5356
if: steps.cache-deps.outputs.cache-hit != 'true'
@@ -56,15 +59,18 @@ jobs:
5659
# Don't cache PLTs based on mix.lock hash, as Dialyzer can incrementally update even old ones
5760
# Cache key based on Elixir & Erlang version (also useful when running in matrix)
5861
- name: Cache Dialyzer's PLT
59-
uses: actions/cache@v2
62+
uses: actions/cache@v3
6063
id: cache-plt
6164
with:
62-
path: priv/plts
63-
key: ${{ runner.os }}-otp${{ matrix.otp }}-elixir${{ matrix.elixir }}
65+
path: plts
66+
key: |
67+
${{ runner.os }}-plt-otp${{ matrix.erlang }}-elixir${{ matrix.elixir }}-${{ hashFiles('**/mix.lock') }}
68+
restore-keys: |
69+
${{ runner.os }}-plt-otp${{ matrix.erlang }}-elixir${{ matrix.elixir }}-
6470
6571
# Create PLTs if no cache was found
6672
- name: Create PLTs
67-
if: ${{matrix.dialyzer && steps.cache-plt.outputs.cache-hit != 'true'}}
73+
if: ${{ matrix.dialyzer && steps.cache-plt.outputs.cache-hit != 'true' }}
6874
run: mix dialyzer --plt
6975

7076
- name: Start docker

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,5 @@ mint-*.tar
2424

2525
/caddy_storage
2626

27+
/plts/*.plt
28+
/plts/*.plt.hash

docker-compose.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ services:
1818

1919
caddyhttpbin:
2020
image: caddy:2.6.4-alpine
21-
# in github actions we want to access the files created
22-
# by caddy. however, in linux these end up being owned by root
23-
# because the container by defaults runs using the root user
24-
# and we are not root in the gh action so cannot access them
21+
# In GitHub Actions we want to access the files created
22+
# by Caddy. However, in Linux these end up being owned by root
23+
# because the container by default runs using the root user
24+
# and we are not root in the GH action so we cannot access them.
2525
user: "${DOCKER_USER}"
2626
volumes:
2727
# The :z mount option solves issues with SELinux.
28-
# See https://github.com/elixir-mint/mint/pull/406.
28+
# See https://github.com/elixir-mint/mint/pull/406.
2929
- "./caddy_storage:/caddy_storage:z"
3030
- "./Caddyfile:/etc/caddy/Caddyfile:z"
3131
ports:

lib/mint/core/transport/ssl.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,7 @@ defmodule Mint.Core.Transport.SSL do
504504
# therefore the only pattern used in commercially issued certificates.
505505
defp match_fun({:dns_id, reference}, {:dNSName, [?*, ?. | presented]}) do
506506
case domain_without_host(reference) do
507-
'' -> :default
507+
~c"" -> :default
508508
domain -> :string.casefold(domain) == :string.casefold(presented)
509509
end
510510
end

lib/mint/http1/parse.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ defmodule Mint.HTTP1.Parse do
55

66
defmacro is_digit(char), do: quote(do: unquote(char) in ?0..?9)
77
defmacro is_alpha(char), do: quote(do: unquote(char) in ?a..?z or unquote(char) in ?A..?Z)
8-
defmacro is_whitespace(char), do: quote(do: unquote(char) in '\s\t')
8+
defmacro is_whitespace(char), do: quote(do: unquote(char) in ~c"\s\t")
99
defmacro is_comma(char), do: quote(do: unquote(char) == ?,)
1010
defmacro is_vchar(char), do: quote(do: unquote(char) in 33..126)
1111

1212
defmacro is_tchar(char) do
1313
quote do
14-
is_digit(unquote(char)) or is_alpha(unquote(char)) or unquote(char) in '!#$%&\'*+-.^_`|~'
14+
is_digit(unquote(char)) or is_alpha(unquote(char)) or unquote(char) in ~c"!#$%&'*+-.^_`|~"
1515
end
1616
end
1717

lib/mint/http1/request.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ defmodule Mint.HTTP1.Request do
4747
end
4848

4949
# Percent-encoding is not case sensitive so we have to account for lowercase and uppercase.
50-
@hex_characters '0123456789abcdefABCDEF'
50+
@hex_characters ~c"0123456789abcdefABCDEF"
5151

5252
defp validate_target!(target), do: validate_target!(target, target)
5353

@@ -82,7 +82,7 @@ defmodule Mint.HTTP1.Request do
8282
defp validate_header_value!(name, value) do
8383
_ =
8484
for <<char <- value>> do
85-
unless is_vchar(char) or char in '\s\t' do
85+
unless is_vchar(char) or char in ~c"\s\t" do
8686
throw({:mint, {:invalid_header_value, name, value}})
8787
end
8888
end

lib/mint/http2.ex

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -232,13 +232,22 @@ defmodule Mint.HTTP2 do
232232
conn = unquote(conn)
233233

234234
if conn.log do
235-
Logger.log(unquote(level), unquote(message))
235+
Logger.log(normalize_logger_level(unquote(level)), unquote(message))
236236
else
237237
:ok
238238
end
239239
end
240240
end
241241

242+
# TODO: remove this once we depend on Elixir 1.11+.
243+
if macro_exported?(Logger, :warning, 2) do
244+
defp normalize_logger_level(:warning), do: :warning
245+
else
246+
defp normalize_logger_level(:warning), do: :warn
247+
end
248+
249+
defp normalize_logger_level(level), do: level
250+
242251
## Types
243252

244253
@typedoc """
@@ -1738,7 +1747,7 @@ defmodule Mint.HTTP2 do
17381747

17391748
# For now we ignore all PRIORITY frames. This shouldn't cause practical trouble.
17401749
defp handle_priority(conn, frame, responses) do
1741-
log(conn, :warn, "Ignoring PRIORITY frame: #{inspect(frame)}")
1750+
log(conn, :warning, "Ignoring PRIORITY frame: #{inspect(frame)}")
17421751
{conn, responses}
17431752
end
17441753

@@ -1824,7 +1833,12 @@ defmodule Mint.HTTP2 do
18241833
apply_client_settings(conn, params)
18251834

18261835
{:empty, conn} ->
1827-
log(conn, :warn, "Received SETTINGS ACK but client is not waiting for ACKs; ignoring it")
1836+
log(
1837+
conn,
1838+
:warning,
1839+
"Received SETTINGS ACK but client is not waiting for ACKs; ignoring it"
1840+
)
1841+
18281842
conn
18291843
end
18301844
end
@@ -1963,11 +1977,11 @@ defmodule Mint.HTTP2 do
19631977
{conn, [{:pong, ref} | responses]}
19641978

19651979
{:value, _} ->
1966-
log(conn, :warn, "Received PING ack that doesn't match next PING request in the queue")
1980+
log(conn, :warning, "Received PING ack that doesn't match next PING request in the queue")
19671981
{conn, responses}
19681982

19691983
:empty ->
1970-
log(conn, :warn, "Received PING ack but no PING requests are pending")
1984+
log(conn, :warning, "Received PING ack but no PING requests are pending")
19711985
{conn, responses}
19721986
end
19731987
end

lib/mint/transport_error.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ defmodule Mint.TransportError do
8585
# error (at least since OTP 19+), so we can just use that.
8686
defp format_reason(reason) do
8787
case :ssl.format_error(reason) do
88-
'Unexpected error:' ++ _ -> inspect(reason)
88+
~c"Unexpected error:" ++ _ -> inspect(reason)
8989
message -> List.to_string(message)
9090
end
9191
end

mix.exs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ defmodule Mint.MixProject do
2424

2525
# Dialyxir
2626
dialyzer: [
27-
plt_add_apps: [:castore]
27+
plt_add_apps: [:castore],
28+
plt_local_path: "plts",
29+
plt_core_path: "plts"
2830
],
2931

3032
# Code coverage
@@ -73,9 +75,9 @@ defmodule Mint.MixProject do
7375
{:hpax, "~> 0.1.1"},
7476

7577
# Dev/test dependencies
76-
{:dialyxir, "~> 1.1.0", only: [:dev, :test], runtime: false},
78+
{:dialyxir, "~> 1.3.0", only: [:dev, :test], runtime: false},
7779
{:ex_doc, "~> 0.20", only: :dev},
78-
{:excoveralls, "~> 0.14.5", only: :test},
80+
{:excoveralls, "~> 0.17.0", only: :test},
7981
{:mox, "~> 1.0", only: :test},
8082
{:stream_data, "~> 0.5.0", only: [:dev, :test]}
8183
]

mix.lock

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,16 @@
11
%{
2-
"castore": {:hex, :castore, "0.1.10", "b01a007416a0ae4188e70b3b306236021b16c11474038ead7aff79dd75538c23", [:mix], [], "hexpm", "a48314e0cb45682db2ea27b8ebfa11bd6fa0a6e21a65e5772ad83ca136ff2665"},
3-
"certifi": {:hex, :certifi, "2.9.0", "6f2a475689dd47f19fb74334859d460a2dc4e3252a3324bd2111b8f0429e7e21", [:rebar3], [], "hexpm", "266da46bdb06d6c6d35fde799bcb28d36d985d424ad7c08b5bb48f5b5cdd4641"},
4-
"dialyxir": {:hex, :dialyxir, "1.1.0", "c5aab0d6e71e5522e77beff7ba9e08f8e02bad90dfbeffae60eaf0cb47e29488", [:mix], [{:erlex, ">= 0.2.6", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "07ea8e49c45f15264ebe6d5b93799d4dd56a44036cf42d0ad9c960bc266c0b9a"},
2+
"castore": {:hex, :castore, "1.0.3", "7130ba6d24c8424014194676d608cb989f62ef8039efd50ff4b3f33286d06db8", [:mix], [], "hexpm", "680ab01ef5d15b161ed6a95449fac5c6b8f60055677a8e79acf01b27baa4390b"},
3+
"dialyxir": {:hex, :dialyxir, "1.3.0", "fd1672f0922b7648ff9ce7b1b26fcf0ef56dda964a459892ad15f6b4410b5284", [:mix], [{:erlex, ">= 0.2.6", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "00b2a4bcd6aa8db9dcb0b38c1225b7277dca9bc370b6438715667071a304696f"},
54
"earmark_parser": {:hex, :earmark_parser, "1.4.30", "0b938aa5b9bafd455056440cdaa2a79197ca5e693830b4a982beada840513c5f", [:mix], [], "hexpm", "3b5385c2d36b0473d0b206927b841343d25adb14f95f0110062506b300cd5a1b"},
65
"erlex": {:hex, :erlex, "0.2.6", "c7987d15e899c7a2f34f5420d2a2ea0d659682c06ac607572df55a43753aa12e", [:mix], [], "hexpm", "2ed2e25711feb44d52b17d2780eabf998452f6efda104877a3881c2f8c0c0c75"},
76
"ex_doc": {:hex, :ex_doc, "0.29.1", "b1c652fa5f92ee9cf15c75271168027f92039b3877094290a75abcaac82a9f77", [:mix], [{:earmark_parser, "~> 1.4.19", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_elixir, "~> 0.14", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1", [hex: :makeup_erlang, repo: "hexpm", optional: false]}], "hexpm", "b7745fa6374a36daf484e2a2012274950e084815b936b1319aeebcf7809574f6"},
8-
"excoveralls": {:hex, :excoveralls, "0.14.5", "5c685449596e962c779adc8f4fb0b4de3a5b291c6121097572a3aa5400c386d3", [:mix], [{:hackney, "~> 1.16", [hex: :hackney, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "e9b4a9bf10e9a6e48b94159e13b4b8a1b05400f17ac16cc363ed8734f26e1f4e"},
9-
"hackney": {:hex, :hackney, "1.18.1", "f48bf88f521f2a229fc7bae88cf4f85adc9cd9bcf23b5dc8eb6a1788c662c4f6", [:rebar3], [{:certifi, "~>2.9.0", [hex: :certifi, repo: "hexpm", optional: false]}, {:idna, "~>6.1.0", [hex: :idna, repo: "hexpm", optional: false]}, {:metrics, "~>1.0.0", [hex: :metrics, repo: "hexpm", optional: false]}, {:mimerl, "~>1.1", [hex: :mimerl, repo: "hexpm", optional: false]}, {:parse_trans, "3.3.1", [hex: :parse_trans, repo: "hexpm", optional: false]}, {:ssl_verify_fun, "~>1.1.0", [hex: :ssl_verify_fun, repo: "hexpm", optional: false]}, {:unicode_util_compat, "~>0.7.0", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm", "a4ecdaff44297e9b5894ae499e9a070ea1888c84afdd1fd9b7b2bc384950128e"},
7+
"excoveralls": {:hex, :excoveralls, "0.17.0", "279f124dba347903bb654bc40745c493ae265d45040001b4899ea1edf88078c7", [:mix], [{:castore, "~> 1.0", [hex: :castore, repo: "hexpm", optional: true]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "08b638d114387a888f9cb8d65f2a0021ec04c3e447b793efa7c1e734aba93004"},
108
"hpax": {:hex, :hpax, "0.1.2", "09a75600d9d8bbd064cdd741f21fc06fc1f4cf3d0fcc335e5aa19be1a7235c84", [:mix], [], "hexpm", "2c87843d5a23f5f16748ebe77969880e29809580efdaccd615cd3bed628a8c13"},
11-
"idna": {:hex, :idna, "6.1.1", "8a63070e9f7d0c62eb9d9fcb360a7de382448200fbbd1b106cc96d3d8099df8d", [:rebar3], [{:unicode_util_compat, "~>0.7.0", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm", "92376eb7894412ed19ac475e4a86f7b413c1b9fbb5bd16dccd57934157944cea"},
12-
"jason": {:hex, :jason, "1.3.0", "fa6b82a934feb176263ad2df0dbd91bf633d4a46ebfdffea0c8ae82953714946", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "53fc1f51255390e0ec7e50f9cb41e751c260d065dcba2bf0d08dc51a4002c2ac"},
9+
"jason": {:hex, :jason, "1.4.1", "af1504e35f629ddcdd6addb3513c3853991f694921b1b9368b0bd32beb9f1b63", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "fbb01ecdfd565b56261302f7e1fcc27c4fb8f32d56eab74db621fc154604a7a1"},
1310
"makeup": {:hex, :makeup, "1.1.0", "6b67c8bc2882a6b6a445859952a602afc1a41c2e08379ca057c0f525366fc3ca", [:mix], [{:nimble_parsec, "~> 1.2.2 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "0a45ed501f4a8897f580eabf99a2e5234ea3e75a4373c8a52824f6e873be57a6"},
1411
"makeup_elixir": {:hex, :makeup_elixir, "0.16.0", "f8c570a0d33f8039513fbccaf7108c5d750f47d8defd44088371191b76492b0b", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.2.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "28b2cbdc13960a46ae9a8858c4bebdec3c9a6d7b4b9e7f4ed1502f8159f338e7"},
1512
"makeup_erlang": {:hex, :makeup_erlang, "0.1.1", "3fcb7f09eb9d98dc4d208f49cc955a34218fc41ff6b84df7c75b3e6e533cc65f", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "174d0809e98a4ef0b3309256cbf97101c6ec01c4ab0b23e926a9e17df2077cbb"},
16-
"metrics": {:hex, :metrics, "1.0.1", "25f094dea2cda98213cecc3aeff09e940299d950904393b2a29d191c346a8486", [:rebar3], [], "hexpm", "69b09adddc4f74a40716ae54d140f93beb0fb8978d8636eaded0c31b6f099f16"},
17-
"mimerl": {:hex, :mimerl, "1.2.0", "67e2d3f571088d5cfd3e550c383094b47159f3eee8ffa08e64106cdf5e981be3", [:rebar3], [], "hexpm", "f278585650aa581986264638ebf698f8bb19df297f66ad91b18910dfc6e19323"},
1813
"mox": {:hex, :mox, "1.0.2", "dc2057289ac478b35760ba74165b4b3f402f68803dd5aecd3bfd19c183815d64", [:mix], [], "hexpm", "f9864921b3aaf763c8741b5b8e6f908f44566f1e427b2630e89e9a73b981fef2"},
1914
"nimble_parsec": {:hex, :nimble_parsec, "1.2.3", "244836e6e3f1200c7f30cb56733fd808744eca61fd182f731eac4af635cc6d0b", [:mix], [], "hexpm", "c8d789e39b9131acf7b99291e93dae60ab48ef14a7ee9d58c6964f59efb570b0"},
20-
"parse_trans": {:hex, :parse_trans, "3.3.1", "16328ab840cc09919bd10dab29e431da3af9e9e7e7e6f0089dd5a2d2820011d8", [:rebar3], [], "hexpm", "07cd9577885f56362d414e8c4c4e6bdf10d43a8767abb92d24cbe8b24c54888b"},
21-
"ssl_verify_fun": {:hex, :ssl_verify_fun, "1.1.6", "cf344f5692c82d2cd7554f5ec8fd961548d4fd09e7d22f5b62482e5aeaebd4b0", [:make, :mix, :rebar3], [], "hexpm", "bdb0d2471f453c88ff3908e7686f86f9be327d065cc1ec16fa4540197ea04680"},
2215
"stream_data": {:hex, :stream_data, "0.5.0", "b27641e58941685c75b353577dc602c9d2c12292dd84babf506c2033cd97893e", [:mix], [], "hexpm", "012bd2eec069ada4db3411f9115ccafa38540a3c78c4c0349f151fc761b9e271"},
23-
"unicode_util_compat": {:hex, :unicode_util_compat, "0.7.0", "bc84380c9ab48177092f43ac89e4dfa2c6d62b40b8bd132b1059ecc7232f9a78", [:rebar3], [], "hexpm", "25eee6d67df61960cf6a794239566599b09e17e668d3700247bc498638152521"},
2416
}

0 commit comments

Comments
 (0)