From d8a623346254fb73f0d6e0905829cf7d2dcfa2e2 Mon Sep 17 00:00:00 2001 From: Alex Koutmos Date: Wed, 7 Aug 2024 16:31:45 -0400 Subject: [PATCH] Fixing CI again --- .formatter.exs | 3 +- .github/workflows/main.yml | 22 +++---- test/support/events/phoenix_live_view.exs | 76 +++++++++++------------ test/support/test_app_router.ex | 46 +++++++------- 4 files changed, 74 insertions(+), 73 deletions(-) diff --git a/.formatter.exs b/.formatter.exs index 3ebaf3c2..8054ff31 100644 --- a/.formatter.exs +++ b/.formatter.exs @@ -1,5 +1,6 @@ # Used by "mix format" [ line_length: 120, - inputs: ["{mix,.formatter}.exs", "{config,lib,test}/**/*.{ex,exs}"] + inputs: ["{mix,.formatter}.exs", "{config,lib,test}/**/*.{ex,exs}"], + import_deps: [:plug, :phoenix_live_view, :phoenix] ] diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 413ecc00..e9f708f7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -5,9 +5,9 @@ env: on: push: - branches: [ master ] + branches: [master] pull_request: - branches: [ master ] + branches: [master] jobs: static_analysis: @@ -16,12 +16,12 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Set up Elixir - uses: erlef/setup-elixir@v1 + uses: erlef/setup-beam@v1 with: - elixir-version: '1.13.4' - otp-version: '25.0' + elixir-version: "1.17.2" + otp-version: "27.0" - name: Restore cache uses: actions/cache@v3 with: @@ -52,16 +52,16 @@ jobs: strategy: matrix: elixir: - - '1.13' + - "1.17" otp: - - '24.0' - - '25.0' + - "26.0" + - "27.0" steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Set up Elixir - uses: erlef/setup-elixir@v1 + uses: erlef/setup-beam@v1 with: elixir-version: ${{ matrix.elixir }} otp-version: ${{ matrix.otp }} diff --git a/test/support/events/phoenix_live_view.exs b/test/support/events/phoenix_live_view.exs index 8394f8ea..5d843061 100644 --- a/test/support/events/phoenix_live_view.exs +++ b/test/support/events/phoenix_live_view.exs @@ -49,18 +49,18 @@ view: WebAppWeb.PageLive }, stacktrace: [ - {WebAppWeb.PageLive, :handle_event, 3, [file: c"lib/web_app_web/live/page_live.ex", line: 24]}, + {WebAppWeb.PageLive, :handle_event, 3, [file: ~c"lib/web_app_web/live/page_live.ex", line: 24]}, {Phoenix.LiveView.Channel, :"-view_handle_event/3-fun-0-", 3, - [file: c"lib/phoenix_live_view/channel.ex", line: 349]}, + [file: ~c"lib/phoenix_live_view/channel.ex", line: 349]}, {:telemetry, :span, 3, [ - file: c"/home/apps/prom_ex/example_applications/web_app/deps/telemetry/src/telemetry.erl", + file: ~c"/home/apps/prom_ex/example_applications/web_app/deps/telemetry/src/telemetry.erl", line: 293 ]}, - {Phoenix.LiveView.Channel, :handle_info, 2, [file: c"lib/phoenix_live_view/channel.ex", line: 206]}, - {:gen_server, :try_dispatch, 4, [file: c"gen_server.erl", line: 695]}, - {:gen_server, :handle_msg, 6, [file: c"gen_server.erl", line: 771]}, - {:proc_lib, :init_p_do_apply, 3, [file: c"proc_lib.erl", line: 226]} + {Phoenix.LiveView.Channel, :handle_info, 2, [file: ~c"lib/phoenix_live_view/channel.ex", line: 206]}, + {:gen_server, :try_dispatch, 4, [file: ~c"gen_server.erl", line: 695]}, + {:gen_server, :handle_msg, 6, [file: ~c"gen_server.erl", line: 771]}, + {:proc_lib, :init_p_do_apply, 3, [file: ~c"proc_lib.erl", line: 226]} ], telemetry_span_context: :erlang.make_ref() } @@ -111,39 +111,39 @@ view: WebAppWeb.PageLive }, stacktrace: [ - {WebAppWeb.PageLive, :mount, 3, [file: c"lib/web_app_web/live/page_live.ex", line: 14]}, + {WebAppWeb.PageLive, :mount, 3, [file: ~c"lib/web_app_web/live/page_live.ex", line: 14]}, {Phoenix.LiveView.Utils, :"-maybe_call_live_view_mount!/4-fun-0-", 5, - [file: c"lib/phoenix_live_view/utils.ex", line: 301]}, + [file: ~c"lib/phoenix_live_view/utils.ex", line: 301]}, {:telemetry, :span, 3, [ - file: c"/home/apps/prom_ex/example_applications/web_app/deps/telemetry/src/telemetry.erl", + file: ~c"/home/apps/prom_ex/example_applications/web_app/deps/telemetry/src/telemetry.erl", line: 293 ]}, {Phoenix.LiveView.Static, :call_mount_and_handle_params!, 5, - [file: c"lib/phoenix_live_view/static.ex", line: 260]}, - {Phoenix.LiveView.Static, :render, 3, [file: c"lib/phoenix_live_view/static.ex", line: 110]}, - {Phoenix.LiveView.Controller, :live_render, 3, [file: c"lib/phoenix_live_view/controller.ex", line: 35]}, - {Phoenix.Router, :__call__, 2, [file: c"lib/phoenix/router.ex", line: 355]}, - {WebAppWeb.Endpoint, :plug_builder_call, 2, [file: c"lib/web_app_web/endpoint.ex", line: 1]}, - {WebAppWeb.Endpoint, :"call (overridable 3)", 2, [file: c"lib/plug/debugger.ex", line: 136]}, - {WebAppWeb.Endpoint, :call, 2, [file: c"lib/web_app_web/endpoint.ex", line: 1]}, - {Phoenix.Endpoint.Cowboy2Handler, :init, 4, [file: c"lib/phoenix/endpoint/cowboy2_handler.ex", line: 54]}, + [file: ~c"lib/phoenix_live_view/static.ex", line: 260]}, + {Phoenix.LiveView.Static, :render, 3, [file: ~c"lib/phoenix_live_view/static.ex", line: 110]}, + {Phoenix.LiveView.Controller, :live_render, 3, [file: ~c"lib/phoenix_live_view/controller.ex", line: 35]}, + {Phoenix.Router, :__call__, 2, [file: ~c"lib/phoenix/router.ex", line: 355]}, + {WebAppWeb.Endpoint, :plug_builder_call, 2, [file: ~c"lib/web_app_web/endpoint.ex", line: 1]}, + {WebAppWeb.Endpoint, :"call (overridable 3)", 2, [file: ~c"lib/plug/debugger.ex", line: 136]}, + {WebAppWeb.Endpoint, :call, 2, [file: ~c"lib/web_app_web/endpoint.ex", line: 1]}, + {Phoenix.Endpoint.Cowboy2Handler, :init, 4, [file: ~c"lib/phoenix/endpoint/cowboy2_handler.ex", line: 54]}, {:cowboy_handler, :execute, 2, [ - file: c"/home/apps/prom_ex/example_applications/web_app/deps/cowboy/src/cowboy_handler.erl", + file: ~c"/home/apps/prom_ex/example_applications/web_app/deps/cowboy/src/cowboy_handler.erl", line: 37 ]}, {:cowboy_stream_h, :execute, 3, [ - file: c"/home/apps/prom_ex/example_applications/web_app/deps/cowboy/src/cowboy_stream_h.erl", + file: ~c"/home/apps/prom_ex/example_applications/web_app/deps/cowboy/src/cowboy_stream_h.erl", line: 306 ]}, {:cowboy_stream_h, :request_process, 3, [ - file: c"/home/apps/prom_ex/example_applications/web_app/deps/cowboy/src/cowboy_stream_h.erl", + file: ~c"/home/apps/prom_ex/example_applications/web_app/deps/cowboy/src/cowboy_stream_h.erl", line: 295 ]}, - {:proc_lib, :init_p_do_apply, 3, [file: c"proc_lib.erl", line: 226]} + {:proc_lib, :init_p_do_apply, 3, [file: ~c"proc_lib.erl", line: 226]} ], telemetry_span_context: :erlang.make_ref() } @@ -194,40 +194,40 @@ view: WebAppWeb.PageLive }, stacktrace: [ - {GenServer, :call, 3, [file: c"lib/gen_server.ex", line: 1014]}, - {WebAppWeb.PageLive, :mount, 3, [file: c"lib/web_app_web/live/page_live.ex", line: 6]}, + {GenServer, :call, 3, [file: ~c"lib/gen_server.ex", line: 1014]}, + {WebAppWeb.PageLive, :mount, 3, [file: ~c"lib/web_app_web/live/page_live.ex", line: 6]}, {Phoenix.LiveView.Utils, :"-maybe_call_live_view_mount!/4-fun-0-", 5, - [file: c"lib/phoenix_live_view/utils.ex", line: 301]}, + [file: ~c"lib/phoenix_live_view/utils.ex", line: 301]}, {:telemetry, :span, 3, [ - file: c"/home/apps/prom_ex/example_applications/web_app/deps/telemetry/src/telemetry.erl", + file: ~c"/home/apps/prom_ex/example_applications/web_app/deps/telemetry/src/telemetry.erl", line: 293 ]}, {Phoenix.LiveView.Static, :call_mount_and_handle_params!, 5, - [file: c"lib/phoenix_live_view/static.ex", line: 260]}, - {Phoenix.LiveView.Static, :render, 3, [file: c"lib/phoenix_live_view/static.ex", line: 110]}, - {Phoenix.LiveView.Controller, :live_render, 3, [file: c"lib/phoenix_live_view/controller.ex", line: 35]}, - {Phoenix.Router, :__call__, 2, [file: c"lib/phoenix/router.ex", line: 355]}, - {WebAppWeb.Endpoint, :plug_builder_call, 2, [file: c"lib/web_app_web/endpoint.ex", line: 1]}, - {WebAppWeb.Endpoint, :"call (overridable 3)", 2, [file: c"lib/plug/debugger.ex", line: 136]}, - {WebAppWeb.Endpoint, :call, 2, [file: c"lib/web_app_web/endpoint.ex", line: 1]}, - {Phoenix.Endpoint.Cowboy2Handler, :init, 4, [file: c"lib/phoenix/endpoint/cowboy2_handler.ex", line: 54]}, + [file: ~c"lib/phoenix_live_view/static.ex", line: 260]}, + {Phoenix.LiveView.Static, :render, 3, [file: ~c"lib/phoenix_live_view/static.ex", line: 110]}, + {Phoenix.LiveView.Controller, :live_render, 3, [file: ~c"lib/phoenix_live_view/controller.ex", line: 35]}, + {Phoenix.Router, :__call__, 2, [file: ~c"lib/phoenix/router.ex", line: 355]}, + {WebAppWeb.Endpoint, :plug_builder_call, 2, [file: ~c"lib/web_app_web/endpoint.ex", line: 1]}, + {WebAppWeb.Endpoint, :"call (overridable 3)", 2, [file: ~c"lib/plug/debugger.ex", line: 136]}, + {WebAppWeb.Endpoint, :call, 2, [file: ~c"lib/web_app_web/endpoint.ex", line: 1]}, + {Phoenix.Endpoint.Cowboy2Handler, :init, 4, [file: ~c"lib/phoenix/endpoint/cowboy2_handler.ex", line: 54]}, {:cowboy_handler, :execute, 2, [ - file: c"/home/apps/prom_ex/example_applications/web_app/deps/cowboy/src/cowboy_handler.erl", + file: ~c"/home/apps/prom_ex/example_applications/web_app/deps/cowboy/src/cowboy_handler.erl", line: 37 ]}, {:cowboy_stream_h, :execute, 3, [ - file: c"/home/apps/prom_ex/example_applications/web_app/deps/cowboy/src/cowboy_stream_h.erl", + file: ~c"/home/apps/prom_ex/example_applications/web_app/deps/cowboy/src/cowboy_stream_h.erl", line: 306 ]}, {:cowboy_stream_h, :request_process, 3, [ - file: c"/home/apps/prom_ex/example_applications/web_app/deps/cowboy/src/cowboy_stream_h.erl", + file: ~c"/home/apps/prom_ex/example_applications/web_app/deps/cowboy/src/cowboy_stream_h.erl", line: 295 ]}, - {:proc_lib, :init_p_do_apply, 3, [file: c"proc_lib.erl", line: 226]} + {:proc_lib, :init_p_do_apply, 3, [file: ~c"proc_lib.erl", line: 226]} ], telemetry_span_context: :erlang.make_ref() } diff --git a/test/support/test_app_router.ex b/test/support/test_app_router.ex index 9015f3a3..b3986aeb 100644 --- a/test/support/test_app_router.ex +++ b/test/support/test_app_router.ex @@ -12,12 +12,12 @@ defmodule TestApp.Router do import Phoenix.LiveView.Router scope "/", TestApp do - live("/", PageLive, :index) - get("/users", UserController, :index) - get("/users/:id", UserController, :show) - post("/users/:id/action/level-up", UserController, :level_up) - post("/users", UserController, :create) - delete("/users/:id", UserController, :delete) + live "/", PageLive, :index + get "/users", UserController, :index + get "/users/:id", UserController, :show + post "/users/:id/action/level-up", UserController, :level_up + post "/users", UserController, :create + delete "/users/:id", UserController, :delete end end @@ -27,12 +27,12 @@ defmodule TestApp.ExternalRouter do import Phoenix.LiveView.Router scope "/external", TestApp do - live("/", PageLive, :index) - get("/users", UserController, :index) - get("/users/:id", UserController, :show) - post("/users/:id/action/level-up", UserController, :level_up) - post("/users", UserController, :create) - delete("/users/:id", UserController, :delete) + live "/", PageLive, :index + get "/users", UserController, :index + get "/users/:id", UserController, :show + post "/users/:id/action/level-up", UserController, :level_up + post "/users", UserController, :create + delete "/users/:id", UserController, :delete end end @@ -42,23 +42,23 @@ defmodule TestApp.InternalRouter do import Phoenix.LiveView.Router scope "/internal", TestApp do - live("/", PageLive, :index) - get("/users", UserController, :index) - get("/users/:id", UserController, :show) - post("/users/:id/action/level-up", UserController, :level_up) - post("/users", UserController, :create) - delete("/users/:id", UserController, :delete) + live "/", PageLive, :index + get "/users", UserController, :index + get "/users/:id", UserController, :show + post "/users/:id/action/level-up", UserController, :level_up + post "/users", UserController, :create + delete "/users/:id", UserController, :delete end end defmodule TestApp.PlugRouter do use Plug.Router - plug(PromEx.Plug, prom_ex_module: TestApp.PromEx, path: "/metrics") - plug(Plug.Telemetry, event_prefix: [:testapp, :plug, :router]) - plug(Plug.Parsers, parsers: [:json], json_decoder: Jason) - plug(:match) - plug(:dispatch, builder_opts()) + plug PromEx.Plug, prom_ex_module: TestApp.PromEx, path: "/metrics" + plug Plug.Telemetry, event_prefix: [:testapp, :plug, :router] + plug Plug.Parsers, parsers: [:json], json_decoder: Jason + plug :match + plug :dispatch get "/users/:id" do conn