Skip to content

Commit 27e7f4f

Browse files
authored
Support more iex versions on otp 25 (#32)
* iex min version 1.13 * bump pinned dep verions * run ci on multiple elixir versions, and run unlocked weekly instead of on pr * bad stylized quotes in copy-paste cron schedule * bad stylized quotes in copy-paste cron schedule * maybe the format is picky * linting * test-only jobs can compile deps in MIX_ENV=test to run faster * bump actions checkout * ranch not compiling, expose diagnostics * remove diag and normalize compilation around shared cache * id setup stage to better name caches * try to reduce compilations on ci * fix dialyzer and bump actions/cache for node 20
1 parent 20ffb62 commit 27e7f4f

File tree

5 files changed

+124
-24
lines changed

5 files changed

+124
-24
lines changed

.github/workflows/ci.yml

Lines changed: 110 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,95 @@ on:
77
push:
88
branches:
99
- main
10+
schedule:
11+
- cron: "0 6 * * 1"
12+
13+
env:
14+
MIX_ENV: test
1015

1116
jobs:
12-
validate:
13-
name: Validate PR
17+
validate_1_13:
18+
name: Validate PR against 1.13
19+
runs-on: ubuntu-latest
20+
if: github.event.schedule != '0 6 * * 1'
21+
steps:
22+
- uses: actions/checkout@v4
23+
24+
- name: Set up Elixir
25+
id: beam
26+
uses: erlef/setup-beam@v1
27+
with:
28+
otp-version: 25.1.x
29+
elixir-version: 1.13.x
30+
31+
- name: Restore dependencies cache
32+
id: mix_cache
33+
uses: actions/cache@v4
34+
with:
35+
path: |
36+
deps
37+
_build
38+
key: mix-${{ runner.os }}-${{ steps.beam.outputs.otp-version }}-${{ steps.beam.outputs.elixir-version }}-${{ hashFiles('**/mix.lock') }}
39+
restore-keys: mix-${{ runner.os }}-${{ steps.beam.outputs.otp-version }}-${{ steps.beam.outputs.elixir-version }}-
40+
41+
- name: Install Dependencies
42+
run: |
43+
mix deps.get
44+
mix deps.compile
45+
46+
- name: Run test
47+
run: mix test
48+
49+
validate_1_14:
50+
name: Validate PR against 1.14
51+
runs-on: ubuntu-latest
52+
if: github.event.schedule != '0 6 * * 1'
53+
steps:
54+
- uses: actions/checkout@v4
55+
56+
- name: Set up Elixir
57+
id: beam
58+
uses: erlef/setup-beam@v1
59+
with:
60+
otp-version: 25.1.x
61+
elixir-version: 1.14.x
62+
63+
- name: Restore dependencies cache
64+
id: mix_cache
65+
uses: actions/cache@v4
66+
with:
67+
path: |
68+
deps
69+
_build
70+
key: mix-${{ runner.os }}-${{ steps.beam.outputs.otp-version }}-${{ steps.beam.outputs.elixir-version }}-${{ hashFiles('**/mix.lock') }}
71+
restore-keys: mix-${{ runner.os }}-${{ steps.beam.outputs.otp-version }}-${{ steps.beam.outputs.elixir-version }}-
72+
73+
- name: Install Dependencies
74+
run: |
75+
mix deps.get
76+
mix deps.compile
77+
78+
- name: Run test
79+
run: mix test
80+
81+
# run all steps on latest supported
82+
validate_1_15:
83+
name: Validate PR against 1.15
1484
runs-on: ubuntu-latest
85+
if: github.event.schedule != '0 6 * * 1'
1586
steps:
16-
- uses: actions/checkout@v3
87+
- uses: actions/checkout@v4
1788

1889
- name: Set up Elixir
90+
id: beam
1991
uses: erlef/setup-beam@v1
2092
with:
2193
otp-version: 25.1.x
2294
elixir-version: 1.15.x
2395

2496
- name: Restore dependencies cache
2597
id: mix_cache
26-
uses: actions/cache@v3
98+
uses: actions/cache@v4
2799
with:
28100
path: |
29101
deps
@@ -35,25 +107,26 @@ jobs:
35107
run: |
36108
mix deps.get
37109
mix deps.compile
110+
MIX_ENV=dev mix deps.compile
38111
39112
- name: Restore PLT cache
40113
id: plt_cache
41-
uses: actions/cache/restore@v3
114+
uses: actions/cache/restore@v4
42115
with:
43116
path: priv/plts
44117
key: plt-${{ runner.os }}-${{ steps.beam.outputs.otp-version }}-${{ steps.beam.outputs.elixir-version }}-${{ hashFiles('**/mix.lock') }}
45118
restore-keys: plt-${{ runner.os }}-${{ steps.beam.outputs.otp-version }}-${{ steps.beam.outputs.elixir-version }}-
46119

47120
- name: Create PLTs
48121
if: steps.plt_cache.outputs.cache-hit != 'true'
49-
run: mix dialyzer --plt
122+
run: MIX_ENV=dev mix dialyzer --plt
50123

51124
# By default, the GitHub Cache action will only save the cache if all
52125
# steps in the job succeed, so we separate the cache restore and save
53126
# steps in case running dialyzer fails.
54127
- name: Save PLT cache
55128
id: plt_cache_save
56-
uses: actions/cache/save@v3
129+
uses: actions/cache/save@v4
57130
if: steps.plt_cache.outputs.cache-hit != 'true'
58131
with:
59132
key: plt-${{ runner.os }}-${{ steps.beam.outputs.otp-version }}-${{ steps.beam.outputs.elixir-version }}-${{ hashFiles('**/mix.lock') }}
@@ -70,10 +143,37 @@ jobs:
70143

71144
# dialyzer takes longer to run, let others fail faster.
72145
- name: Run dialyzer
73-
run: mix dialyzer --format github
146+
run: MIX_ENV=dev mix dialyzer --format github
74147

75-
- name: unlocked lib test
148+
validate_unlocked:
149+
name: Validate Code With Unlocked Dependencies
150+
runs-on: ubuntu-latest
151+
if: github.event.schedule == '0 6 * * 1'
152+
steps:
153+
- uses: actions/checkout@v4
154+
155+
- name: Set up Elixir
156+
id: beam
157+
uses: erlef/setup-beam@v1
158+
with:
159+
otp-version: 25.1.x
160+
elixir-version: 1.15.x
161+
162+
- name: Restore dependencies cache
163+
id: mix_cache
164+
uses: actions/cache@v4
165+
with:
166+
path: |
167+
deps
168+
_build
169+
key: mix-${{ runner.os }}-${{ steps.beam.outputs.otp-version }}-${{ steps.beam.outputs.elixir-version }}-${{ hashFiles('**/mix.lock') }}
170+
restore-keys: mix-${{ runner.os }}-${{ steps.beam.outputs.otp-version }}-${{ steps.beam.outputs.elixir-version }}-
171+
172+
- name: Install Dependencies
76173
run: |
77174
mix deps.unlock --all
78175
mix deps.get
79-
mix test
176+
mix deps.compile
177+
178+
- name: Run test
179+
run: mix test

lib/grpc_reflection/service/builder.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ defmodule GrpcReflection.Service.Builder do
126126
)
127127

128128
message_list =
129-
for ext <- extension_files, Util.is_message_descriptor?(ext) do
129+
for ext <- extension_files, Util.message_descriptor?(ext) do
130130
ext.type_name
131131
|> Util.convert_symbol_to_module()
132132
|> then(& &1.descriptor())

lib/grpc_reflection/service/builder/util.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,10 @@ defmodule GrpcReflection.Service.Builder.Util do
106106
|> Module.safe_concat()
107107
end
108108

109-
def is_message_descriptor?(%Google.Protobuf.FieldDescriptorProto{type: @type_message}),
109+
def message_descriptor?(%Google.Protobuf.FieldDescriptorProto{type: @type_message}),
110110
do: true
111111

112-
def is_message_descriptor?(_), do: false
112+
def message_descriptor?(_), do: false
113113

114114
def get_syntax(module) do
115115
cond do

mix.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ defmodule GrpcReflection.MixProject do
1010
app: :grpc_reflection,
1111
version: @version,
1212
description: @description,
13-
elixir: "~> 1.15",
13+
elixir: "~> 1.13",
1414
elixirc_paths: elixirc_paths(Mix.env()),
1515
start_permanent: Mix.env() == :prod,
1616
deps: deps(),

mix.lock

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
%{
2-
"bunt": {:hex, :bunt, "0.2.1", "e2d4792f7bc0ced7583ab54922808919518d0e57ee162901a16a1b6664ef3b14", [:mix], [], "hexpm", "a330bfb4245239787b15005e66ae6845c9cd524a288f0d141c148b02603777a5"},
3-
"cowboy": {:hex, :cowboy, "2.10.0", "ff9ffeff91dae4ae270dd975642997afe2a1179d94b1887863e43f681a203e26", [:make, :rebar3], [{:cowlib, "2.12.1", [hex: :cowlib, repo: "hexpm", optional: false]}, {:ranch, "1.8.0", [hex: :ranch, repo: "hexpm", optional: false]}], "hexpm", "3afdccb7183cc6f143cb14d3cf51fa00e53db9ec80cdcd525482f5e99bc41d6b"},
4-
"cowlib": {:hex, :cowlib, "2.12.1", "a9fa9a625f1d2025fe6b462cb865881329b5caff8f1854d1cbc9f9533f00e1e1", [:make, :rebar3], [], "hexpm", "163b73f6367a7341b33c794c4e88e7dbfe6498ac42dcd69ef44c5bc5507c8db0"},
5-
"credo": {:hex, :credo, "1.7.1", "6e26bbcc9e22eefbff7e43188e69924e78818e2fe6282487d0703652bc20fd62", [:mix], [{:bunt, "~> 0.2.1", [hex: :bunt, repo: "hexpm", optional: false]}, {:file_system, "~> 0.2.8", [hex: :file_system, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "e9871c6095a4c0381c89b6aa98bc6260a8ba6addccf7f6a53da8849c748a58a2"},
6-
"dialyxir": {:hex, :dialyxir, "1.4.2", "764a6e8e7a354f0ba95d58418178d486065ead1f69ad89782817c296d0d746a5", [:mix], [{:erlex, ">= 0.2.6", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "516603d8067b2fd585319e4b13d3674ad4f314a5902ba8130cd97dc902ce6bbd"},
2+
"bunt": {:hex, :bunt, "1.0.0", "081c2c665f086849e6d57900292b3a161727ab40431219529f13c4ddcf3e7a44", [:mix], [], "hexpm", "dc5f86aa08a5f6fa6b8096f0735c4e76d54ae5c9fa2c143e5a1fc7c1cd9bb6b5"},
3+
"cowboy": {:hex, :cowboy, "2.12.0", "f276d521a1ff88b2b9b4c54d0e753da6c66dd7be6c9fca3d9418b561828a3731", [:make, :rebar3], [{:cowlib, "2.13.0", [hex: :cowlib, repo: "hexpm", optional: false]}, {:ranch, "1.8.0", [hex: :ranch, repo: "hexpm", optional: false]}], "hexpm", "8a7abe6d183372ceb21caa2709bec928ab2b72e18a3911aa1771639bef82651e"},
4+
"cowlib": {:hex, :cowlib, "2.13.0", "db8f7505d8332d98ef50a3ef34b34c1afddec7506e4ee4dd4a3a266285d282ca", [:make, :rebar3], [], "hexpm", "e1e1284dc3fc030a64b1ad0d8382ae7e99da46c3246b815318a4b848873800a4"},
5+
"credo": {:hex, :credo, "1.7.5", "643213503b1c766ec0496d828c90c424471ea54da77c8a168c725686377b9545", [:mix], [{:bunt, "~> 0.2.1 or ~> 1.0", [hex: :bunt, repo: "hexpm", optional: false]}, {:file_system, "~> 0.2 or ~> 1.0", [hex: :file_system, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "f799e9b5cd1891577d8c773d245668aa74a2fcd15eb277f51a0131690ebfb3fd"},
6+
"dialyxir": {:hex, :dialyxir, "1.4.3", "edd0124f358f0b9e95bfe53a9fcf806d615d8f838e2202a9f430d59566b6b53b", [:mix], [{:erlex, ">= 0.2.6", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "bf2cfb75cd5c5006bec30141b131663299c661a864ec7fbbc72dfa557487a986"},
77
"erlex": {:hex, :erlex, "0.2.6", "c7987d15e899c7a2f34f5420d2a2ea0d659682c06ac607572df55a43753aa12e", [:mix], [], "hexpm", "2ed2e25711feb44d52b17d2780eabf998452f6efda104877a3881c2f8c0c0c75"},
8-
"file_system": {:hex, :file_system, "0.2.10", "fb082005a9cd1711c05b5248710f8826b02d7d1784e7c3451f9c1231d4fc162d", [:mix], [], "hexpm", "41195edbfb562a593726eda3b3e8b103a309b733ad25f3d642ba49696bf715dc"},
8+
"file_system": {:hex, :file_system, "1.0.0", "b689cc7dcee665f774de94b5a832e578bd7963c8e637ef940cd44327db7de2cd", [:mix], [], "hexpm", "6752092d66aec5a10e662aefeed8ddb9531d79db0bc145bb8c40325ca1d8536d"},
99
"google_protos": {:hex, :google_protos, "0.4.0", "93e1be2c1a07517ffed761f69047776caf35e4acd385aac4f5ce4fedd07f3660", [:mix], [{:protobuf, "~> 0.10", [hex: :protobuf, repo: "hexpm", optional: false]}], "hexpm", "4c54983d78761a3643e2198adf0f5d40a5a8b08162f3fc91c50faa257f3fa19f"},
10-
"grpc": {:hex, :grpc, "0.7.0", "a86eab356b0b84406b526786a947ca50e9b9eae87108c873b51e321f8a71e8ed", [:mix], [{:cowboy, "~> 2.10", [hex: :cowboy, repo: "hexpm", optional: false]}, {:cowlib, "~> 2.12", [hex: :cowlib, repo: "hexpm", optional: false]}, {:gun, "~> 2.0", [hex: :gun, repo: "hexpm", optional: false]}, {:mint, "~> 1.5", [hex: :mint, repo: "hexpm", optional: false]}, {:telemetry, "~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "632a9507da8d3c12b112b197db4d60da3c95bad02594d37711eeb622d032f254"},
11-
"gun": {:hex, :gun, "2.0.1", "160a9a5394800fcba41bc7e6d421295cf9a7894c2252c0678244948e3336ad73", [:make, :rebar3], [{:cowlib, "2.12.1", [hex: :cowlib, repo: "hexpm", optional: false]}], "hexpm", "a10bc8d6096b9502205022334f719cc9a08d9adcfbfc0dbee9ef31b56274a20b"},
12-
"hpax": {:hex, :hpax, "0.1.2", "09a75600d9d8bbd064cdd741f21fc06fc1f4cf3d0fcc335e5aa19be1a7235c84", [:mix], [], "hexpm", "2c87843d5a23f5f16748ebe77969880e29809580efdaccd615cd3bed628a8c13"},
10+
"grpc": {:hex, :grpc, "0.8.1", "a8a5884a0d41fc30679c269d0332571cebb43cbfd6eb3d4819169778e866343e", [:mix], [{:castore, "~> 0.1 or ~> 1.0", [hex: :castore, repo: "hexpm", optional: true]}, {:cowboy, "~> 2.10", [hex: :cowboy, repo: "hexpm", optional: false]}, {:cowlib, "~> 2.12", [hex: :cowlib, repo: "hexpm", optional: false]}, {:gun, "~> 2.0", [hex: :gun, repo: "hexpm", optional: false]}, {:jason, ">= 0.0.0", [hex: :jason, repo: "hexpm", optional: true]}, {:mint, "~> 1.5", [hex: :mint, repo: "hexpm", optional: false]}, {:protobuf, "~> 0.11", [hex: :protobuf, repo: "hexpm", optional: false]}, {:telemetry, "~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "1cccd9fd83547a562f315cc0e1ee1879546f0a44193b5c8eb8d68dae0bb2065b"},
11+
"gun": {:hex, :gun, "2.1.0", "b4e4cbbf3026d21981c447e9e7ca856766046eff693720ba43114d7f5de36e87", [:make, :rebar3], [{:cowlib, "2.13.0", [hex: :cowlib, repo: "hexpm", optional: false]}], "hexpm", "52fc7fc246bfc3b00e01aea1c2854c70a366348574ab50c57dfe796d24a0101d"},
12+
"hpax": {:hex, :hpax, "0.2.0", "5a58219adcb75977b2edce5eb22051de9362f08236220c9e859a47111c194ff5", [:mix], [], "hexpm", "bea06558cdae85bed075e6c036993d43cd54d447f76d8190a8db0dc5893fa2f1"},
1313
"jason": {:hex, :jason, "1.4.1", "af1504e35f629ddcdd6addb3513c3853991f694921b1b9368b0bd32beb9f1b63", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "fbb01ecdfd565b56261302f7e1fcc27c4fb8f32d56eab74db621fc154604a7a1"},
14-
"mint": {:hex, :mint, "1.5.1", "8db5239e56738552d85af398798c80648db0e90f343c8469f6c6d8898944fb6f", [:mix], [{:castore, "~> 0.1.0 or ~> 1.0", [hex: :castore, repo: "hexpm", optional: true]}, {:hpax, "~> 0.1.1", [hex: :hpax, repo: "hexpm", optional: false]}], "hexpm", "4a63e1e76a7c3956abd2c72f370a0d0aecddc3976dea5c27eccbecfa5e7d5b1e"},
14+
"mint": {:hex, :mint, "1.6.0", "88a4f91cd690508a04ff1c3e28952f322528934be541844d54e0ceb765f01d5e", [:mix], [{:castore, "~> 0.1.0 or ~> 1.0", [hex: :castore, repo: "hexpm", optional: true]}, {:hpax, "~> 0.1.1 or ~> 0.2.0", [hex: :hpax, repo: "hexpm", optional: false]}], "hexpm", "3c5ae85d90a5aca0a49c0d8b67360bbe407f3b54f1030a111047ff988e8fefaa"},
1515
"protobuf": {:hex, :protobuf, "0.12.0", "58c0dfea5f929b96b5aa54ec02b7130688f09d2de5ddc521d696eec2a015b223", [:mix], [{:jason, "~> 1.2", [hex: :jason, repo: "hexpm", optional: true]}], "hexpm", "75fa6cbf262062073dd51be44dd0ab940500e18386a6c4e87d5819a58964dc45"},
1616
"ranch": {:hex, :ranch, "1.8.0", "8c7a100a139fd57f17327b6413e4167ac559fbc04ca7448e9be9057311597a1d", [:make, :rebar3], [], "hexpm", "49fbcfd3682fab1f5d109351b61257676da1a2fdbe295904176d5e521a2ddfe5"},
1717
"telemetry": {:hex, :telemetry, "1.2.1", "68fdfe8d8f05a8428483a97d7aab2f268aaff24b49e0f599faa091f1d4e7f61c", [:rebar3], [], "hexpm", "dad9ce9d8effc621708f99eac538ef1cbe05d6a874dd741de2e689c47feafed5"},

0 commit comments

Comments
 (0)