Skip to content

Commit 536dd30

Browse files
authored
Merge pull request #123 from appsignal/fix-ci-old-elixir
Fix CI for Elixir < 1.14 and lint issues
2 parents 69e1985 + 4d82597 commit 536dd30

4 files changed

Lines changed: 65 additions & 7 deletions

File tree

.github/workflows/ci.yml

Lines changed: 54 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,40 +96,88 @@ jobs:
9696
fail-fast: false
9797
matrix:
9898
elixir:
99-
- 1.17.x
99+
- 1.19.x
100100
otp:
101+
- 28.x
101102
- 27.x
102103
- 26.x
103-
- 25.x
104104
phoenix:
105105
- "~> 1.6.0"
106106
- "~> 1.7.0"
107-
- "~> 1.8.0"
107+
- "~> 1.8"
108108
include:
109109
- elixir: main
110+
otp: 28.x
111+
phoenix: "~> 1.8"
112+
- elixir: latest
113+
otp: 28.x
114+
phoenix: "~> 1.8"
115+
- elixir: 1.18.x
116+
otp: 27.x
117+
phoenix: "~> 1.8"
118+
- elixir: 1.18.x
110119
otp: 27.x
111120
phoenix: "~> 1.7.0"
112-
- elixir: latest
121+
- elixir: 1.18.x
122+
otp: 27.x
123+
phoenix: "~> 1.6.0"
124+
- elixir: 1.17.x
125+
otp: 27.x
126+
phoenix: "~> 1.8"
127+
- elixir: 1.17.x
113128
otp: 27.x
114129
phoenix: "~> 1.7.0"
130+
- elixir: 1.17.x
131+
otp: 27.x
132+
phoenix: "~> 1.6.0"
115133
- elixir: 1.16.x
134+
otp: 26.x
135+
phoenix: "~> 1.8"
136+
- elixir: 1.16.x
137+
otp: 26.x
138+
phoenix: "~> 1.7.0"
139+
- elixir: 1.16.x
140+
otp: 26.x
141+
phoenix: "~> 1.6.0"
142+
- elixir: 1.15.x
143+
otp: 26.x
144+
phoenix: "~> 1.8"
145+
- elixir: 1.15.x
116146
otp: 26.x
117147
phoenix: "~> 1.7.0"
118148
- elixir: 1.15.x
119149
otp: 26.x
150+
phoenix: "~> 1.6.0"
151+
- elixir: 1.14.x
152+
otp: 25.x
120153
phoenix: "~> 1.7.0"
121154
- elixir: 1.14.x
122155
otp: 25.x
123156
phoenix: "~> 1.6.0"
157+
- elixir: 1.13.x
158+
otp: 24.x
159+
phoenix: "~> 1.7.0"
160+
plug: "~> 1.18.0"
124161
- elixir: 1.13.x
125162
otp: 24.x
126163
phoenix: "~> 1.6.0"
164+
plug: "~> 1.18.0"
165+
- elixir: 1.12.x
166+
otp: 24.x
167+
phoenix: "~> 1.7.0"
168+
plug: "~> 1.18.0"
127169
- elixir: 1.12.x
128170
otp: 24.x
129171
phoenix: "~> 1.6.0"
172+
plug: "~> 1.18.0"
173+
- elixir: 1.11.x
174+
otp: 24.x
175+
phoenix: "~> 1.7.0"
176+
plug: "~> 1.18.0"
130177
- elixir: 1.11.x
131178
otp: 24.x
132179
phoenix: "~> 1.6.0"
180+
plug: "~> 1.18.0"
133181

134182
steps:
135183
- name: Set up Erlang and Elixir
@@ -143,7 +191,9 @@ jobs:
143191
run: mix deps.get
144192
env:
145193
_APPSIGNAL_CI_PHOENIX_VERSION: ${{matrix.phoenix}}
194+
_APPSIGNAL_CI_PLUG_VERSION: ${{matrix.plug}}
146195
- name: Run tests
147196
run: mix test
148197
env:
149198
_APPSIGNAL_CI_PHOENIX_VERSION: ${{matrix.phoenix}}
199+
_APPSIGNAL_CI_PLUG_VERSION: ${{matrix.plug}}

lib/appsignal_phoenix/view.ex

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
defmodule Appsignal.Phoenix.View do
2-
require Logger
3-
42
@moduledoc """
53
AppSignal.Phoenix.View instruments template rendering.
64

mix.exs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,13 @@ defmodule Appsignal.Phoenix.MixProject do
5959

6060
phoenix_version = System.get_env("_APPSIGNAL_CI_PHOENIX_VERSION") || "~> 1.7"
6161

62+
plug_override =
63+
case System.get_env("_APPSIGNAL_CI_PLUG_VERSION") do
64+
nil -> []
65+
"" -> []
66+
version -> [{:plug, version, override: true}]
67+
end
68+
6269
[
6370
{:appsignal, ">= 2.15.0 and < 3.0.0"},
6471
{:appsignal_plug, ">= 2.1.0 and < 3.0.0"},
@@ -69,6 +76,6 @@ defmodule Appsignal.Phoenix.MixProject do
6976
{:dialyxir, "~> 1.3.0", only: [:dev, :test], runtime: false},
7077
{:credo, credo_version, only: [:dev, :test], runtime: false},
7178
{:telemetry, "~> 0.4 or ~> 1.0"}
72-
]
79+
] ++ plug_override
7380
end
7481
end

test/support/phoenix_web.ex

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ defmodule PhoenixWeb.Endpoint do
1212
end
1313

1414
defmodule PhoenixWeb.Controller do
15+
@moduledoc false
1516
use Phoenix.Controller, formats: [:html]
1617
import Plug.Conn
1718

@@ -28,6 +29,7 @@ end
2829

2930
if function_exported?(Phoenix.View, :__info__, 1) do
3031
defmodule PhoenixWeb.View do
32+
@moduledoc false
3133
use Phoenix.View,
3234
root: "test/support",
3335
namespace: AppsignalPhoenixExampleWeb
@@ -37,6 +39,7 @@ if function_exported?(Phoenix.View, :__info__, 1) do
3739
end
3840

3941
defmodule PhoenixWeb.Channel do
42+
@moduledoc false
4043
use Phoenix.Channel
4144
require Appsignal.Phoenix.Channel
4245

0 commit comments

Comments
 (0)