Skip to content

Commit 8df6b5b

Browse files
authored
Support OTP/28 in CI (#37) (#41)
List of changes: - bump GitHub actions - bump stream_data to remove deprecation warnings - fix test error with OTP 28 not autoloading module - specific versions as string and use latest version in CI matrix
1 parent 756ea8c commit 8df6b5b

4 files changed

Lines changed: 16 additions & 13 deletions

File tree

.github/workflows/ci.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,13 @@ jobs:
2121
- pair:
2222
elixir: "1.18"
2323
otp: "28"
24+
- pair:
25+
elixir: "1.19"
26+
otp: "28"
2427
lint: lint
2528
distribution: distribution
2629
steps:
27-
- uses: actions/checkout@v5
30+
- uses: actions/checkout@v6
2831

2932
- uses: erlef/setup-beam@v1
3033
with:

mix.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ defmodule BroadwayDashboard.MixProject do
3636
{:plug_cowboy, "~> 2.0", only: :dev},
3737
{:jason, "~> 1.0", only: [:dev, :test, :docs]},
3838
{:ex_doc, "~> 0.24", only: [:docs], runtime: false},
39-
{:stream_data, "~> 0.5", only: [:dev, :test]},
39+
{:stream_data, "~> 1.0", only: [:dev, :test]},
4040
{:floki, "~> 0.34", only: :test}
4141
]
4242
end

mix.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"plug_cowboy": {:hex, :plug_cowboy, "2.7.1", "87677ffe3b765bc96a89be7960f81703223fe2e21efa42c125fcd0127dd9d6b2", [:mix], [{:cowboy, "~> 2.7", [hex: :cowboy, repo: "hexpm", optional: false]}, {:cowboy_telemetry, "~> 0.3", [hex: :cowboy_telemetry, repo: "hexpm", optional: false]}, {:plug, "~> 1.14", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "02dbd5f9ab571b864ae39418db7811618506256f6d13b4a45037e5fe78dc5de3"},
2929
"plug_crypto": {:hex, :plug_crypto, "2.1.0", "f44309c2b06d249c27c8d3f65cfe08158ade08418cf540fd4f72d4d6863abb7b", [:mix], [], "hexpm", "131216a4b030b8f8ce0f26038bc4421ae60e4bb95c5cf5395e1421437824c4fa"},
3030
"ranch": {:hex, :ranch, "1.8.0", "8c7a100a139fd57f17327b6413e4167ac559fbc04ca7448e9be9057311597a1d", [:make, :rebar3], [], "hexpm", "49fbcfd3682fab1f5d109351b61257676da1a2fdbe295904176d5e521a2ddfe5"},
31-
"stream_data": {:hex, :stream_data, "0.6.0", "e87a9a79d7ec23d10ff83eb025141ef4915eeb09d4491f79e52f2562b73e5f47", [:mix], [], "hexpm", "b92b5031b650ca480ced047578f1d57ea6dd563f5b57464ad274718c9c29501c"},
31+
"stream_data": {:hex, :stream_data, "1.2.0", "58dd3f9e88afe27dc38bef26fce0c84a9e7a96772b2925c7b32cd2435697a52b", [:mix], [], "hexpm", "eb5c546ee3466920314643edf68943a5b14b32d1da9fe01698dc92b73f89a9ed"},
3232
"telemetry": {:hex, :telemetry, "1.2.1", "68fdfe8d8f05a8428483a97d7aab2f268aaff24b49e0f599faa091f1d4e7f61c", [:rebar3], [], "hexpm", "dad9ce9d8effc621708f99eac538ef1cbe05d6a874dd741de2e689c47feafed5"},
3333
"telemetry_metrics": {:hex, :telemetry_metrics, "1.0.0", "29f5f84991ca98b8eb02fc208b2e6de7c95f8bb2294ef244a176675adc7775df", [:mix], [{:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "f23713b3847286a534e005126d4c959ebcca68ae9582118ce436b521d1d47d5d"},
3434
"websock": {:hex, :websock, "0.5.3", "2f69a6ebe810328555b6fe5c831a851f485e303a7c8ce6c5f675abeb20ebdadc", [:mix], [], "hexpm", "6105453d7fac22c712ad66fab1d45abdf049868f253cf719b625151460b8b453"},

test/support/broadway_support.ex

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,6 @@ defmodule BroadwayDashboard.BroadwaySupport do
1818
defmodule ForwarderViaName do
1919
use Broadway
2020

21-
# For some reason, this module needs to always be compiled in order
22-
# to see the "process_name/2" function implemented.
23-
# TODO: investigate
24-
def __mix_recompile__?(), do: true
25-
2621
def process_name({:via, registry, {registry_name, name}}, base_name) do
2722
{:via, registry, {registry_name, {name, base_name}}}
2823
end
@@ -49,11 +44,16 @@ defmodule BroadwayDashboard.BroadwaySupport do
4944
opts
5045
)
5146

52-
cond do
53-
is_atom(name) -> Forwarder
54-
is_tuple(name) -> ForwarderViaName
55-
end
56-
|> Broadway.start_link([{:name, name} | opts])
47+
module =
48+
cond do
49+
is_atom(name) -> Forwarder
50+
is_tuple(name) -> ForwarderViaName
51+
end
52+
53+
# Ensure the module is loaded so that function_exported?/3 works.
54+
# OTP 28 no longer auto-loads modules in erlang:function_exported/3.
55+
Code.ensure_loaded!(module)
56+
Broadway.start_link(module, [{:name, name} | opts])
5757

5858
name
5959
end

0 commit comments

Comments
 (0)