Skip to content

Commit

Permalink
Merge pull request #7 from hrzndhrn/1.17-otp27
Browse files Browse the repository at this point in the history
Updates for 1.17.1-otp27
  • Loading branch information
NickNeck authored Jun 23, 2024
2 parents f314465 + 9c2af04 commit 63c33a7
Show file tree
Hide file tree
Showing 17 changed files with 450 additions and 422 deletions.
63 changes: 29 additions & 34 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Created with GitHubActions version 0.2.22
# Created with GitHubActions version 0.2.23
name: CI
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -12,50 +12,45 @@ jobs:
strategy:
matrix:
elixir:
- '1.11.4'
- '1.12.3'
- '1.13.4'
- '1.14.5'
- '1.15.7'
- '1.16.2'
- '1.15.8'
- '1.16.3'
- '1.17.1'
otp:
- '21.3'
- '22.3'
- '23.3'
- '24.3'
- '25.3'
- '26.2'
- '27.0'
exclude:
- elixir: '1.11.4'
otp: '25.3'
- elixir: '1.11.4'
otp: '26.2'
- elixir: '1.12.3'
otp: '21.3'
- elixir: '1.12.3'
otp: '25.3'
- elixir: '1.12.3'
otp: '26.2'
- elixir: '1.13.4'
otp: '21.3'
- elixir: '1.13.4'
otp: '26.2'
- elixir: '1.13.4'
otp: '27.0'
- elixir: '1.14.5'
otp: '21.3'
otp: '22.3'
- elixir: '1.14.5'
otp: '27.0'
- elixir: '1.15.8'
otp: '22.3'
- elixir: '1.15.7'
otp: '21.3'
- elixir: '1.15.7'
- elixir: '1.15.8'
otp: '23.3'
- elixir: '1.15.8'
otp: '27.0'
- elixir: '1.16.3'
otp: '22.3'
- elixir: '1.15.7'
- elixir: '1.16.3'
otp: '23.3'
- elixir: '1.16.2'
otp: '21.3'
- elixir: '1.16.2'
- elixir: '1.16.3'
otp: '27.0'
- elixir: '1.17.1'
otp: '22.3'
- elixir: '1.16.2'
- elixir: '1.17.1'
otp: '23.3'
- elixir: '1.17.1'
otp: '24.3'
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -79,28 +74,28 @@ jobs:
with:
path: test/support/plts
key: test/support/plts-${{ runner.os }}-${{ matrix.elixir }}-${{ matrix.otp }}-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
if: ${{ contains(matrix.elixir, '1.16.2') && contains(matrix.otp, '26.2') }}
if: ${{ contains(matrix.elixir, '1.17.1') && contains(matrix.otp, '27.0') }}
- name: Get dependencies
run: mix deps.get
- name: Compile dependencies
run: MIX_ENV=test mix deps.compile
- name: Compile project
run: MIX_ENV=test mix compile --warnings-as-errors
- name: Check unused dependencies
if: ${{ contains(matrix.elixir, '1.16.2') && contains(matrix.otp, '26.2') }}
if: ${{ contains(matrix.elixir, '1.17.1') && contains(matrix.otp, '27.0') }}
run: mix deps.unlock --check-unused
- name: Check code format
if: ${{ contains(matrix.elixir, '1.16.2') && contains(matrix.otp, '26.2') }}
if: ${{ contains(matrix.elixir, '1.17.1') && contains(matrix.otp, '27.0') }}
run: mix format --check-formatted
- name: Lint code
if: ${{ contains(matrix.elixir, '1.16.2') && contains(matrix.otp, '26.2') }}
if: ${{ contains(matrix.elixir, '1.17.1') && contains(matrix.otp, '27.0') }}
run: mix credo --strict
- name: Run tests
run: mix test
if: ${{ !(contains(matrix.elixir, '1.16.2') && contains(matrix.otp, '26.2')) }}
if: ${{ !(contains(matrix.elixir, '1.17.1') && contains(matrix.otp, '27.0')) }}
- name: Run tests with coverage
run: mix coveralls.github
if: ${{ contains(matrix.elixir, '1.16.2') && contains(matrix.otp, '26.2') }}
if: ${{ contains(matrix.elixir, '1.17.1') && contains(matrix.otp, '27.0') }}
- name: Static code analysis
run: mix dialyzer --format github --force-check
if: ${{ contains(matrix.elixir, '1.16.2') && contains(matrix.otp, '26.2') }}
if: ${{ contains(matrix.elixir, '1.17.1') && contains(matrix.otp, '27.0') }}
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## 0.2.22 2024/06/23

- Update inspect implementation for `GitHubActions.Version`
- Require Elixir verions 1.13
- Add Elixir version `1.17.1` to config
- Add Erlang version `27.0` to config

## 0.2.22 2024/03/16

- Update to `actions/cache@v4`
Expand Down
2 changes: 1 addition & 1 deletion lib/git_hub_actions/project.ex
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ defmodule GitHubActions.Project do
## Examples
iex> Project.elixir()
"~> 1.11"
"~> 1.13"
"""
@spec elixir :: String.t()
def elixir do
Expand Down
28 changes: 14 additions & 14 deletions lib/git_hub_actions/version.ex
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ defmodule GitHubActions.Version do
"!"
]
@fields [:major, :minor, :patch]

@derive {Inspect, optional: [:minor, :patch]}
defstruct @fields

@type version :: String.t() | t
Expand All @@ -53,23 +53,23 @@ defmodule GitHubActions.Version do
iex> {:ok, version} = Version.parse("1.2")
iex> version
#Version<1.2>
%GitHubActions.Version{major: 1, minor: 2}
iex> Version.parse("1-2")
:error
iex> {:ok, [v1, v2, v3]} = Version.parse("2.2/4")
iex> v1
#Version<2.2>
%GitHubActions.Version{major: 2, minor: 2}
iex> v2
#Version<2.3>
%GitHubActions.Version{major: 2, minor: 3}
iex> v3
#Version<2.4>
%GitHubActions.Version{major: 2, minor: 4}
iex> {:ok, version} = Version.parse("1.2")
iex> {:ok, version} = Version.parse(version)
iex> version
#Version<1.2>
%GitHubActions.Version{major: 1, minor: 2}
"""
@spec parse(String.t() | t()) :: {:ok, t()} | :error
def parse(string) when is_binary(string) do
Expand All @@ -94,13 +94,13 @@ defmodule GitHubActions.Version do
## Examples
iex> Version.parse!("1")
#Version<1>
%GitHubActions.Version{major: 1}
iex> Version.parse!("1.2")
#Version<1.2>
%GitHubActions.Version{major: 1, minor: 2}
iex> Version.parse!("1.2.3")
#Version<1.2.3>
%GitHubActions.Version{major: 1, minor: 2, patch: 3}
iex> Version.parse!("invalid")
** (GitHubActions.InvalidVersionError) invalid version: "invalid"
Expand Down Expand Up @@ -286,11 +286,11 @@ defimpl String.Chars, for: GitHubActions.Version do
end
end

defimpl Inspect, for: GitHubActions.Version do
def inspect(self, _opts) do
"#Version<#{to_string(self)}>"
end
end
# defimpl Inspect, for: GitHubActions.Version do
# def inspect(self, _opts) do
# "#Version<#{to_string(self)}>"
# end
# end

defmodule GitHubActions.InvalidVersionError do
defexception [:version]
Expand Down
42 changes: 25 additions & 17 deletions lib/git_hub_actions/versions.ex
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ defmodule GitHubActions.Versions do
iex> Config.config(:versions, ["1.0.0/2", "1.1.0/3"])
iex> Versions.latest()
#Version<1.1.3>
%GitHubActions.Version{major: 1, minor: 1, patch: 3}
"""
@spec latest :: Version.t()
def latest, do: latest(from_config())
Expand All @@ -44,14 +44,14 @@ defmodule GitHubActions.Versions do
## Examples
iex> Versions.latest(["1.0.0/2", "1.1.0/3"])
#Version<1.1.3>
%GitHubActions.Version{major: 1, minor: 1, patch: 3}
iex> Config.config(:versions, [
...> [a: ["1.0.0/2", "1.1.0/3"], b: ["2.0/5"]],
...> [a: ["1.2.0/1", "1.3.0/4"], b: ["3.0/5"]]
...> ])
iex> Versions.latest(:a)
#Version<1.3.4>
%GitHubActions.Version{major: 1, minor: 3, patch: 4}
iex> Versions.latest(["foo"])
** (GitHubActions.InvalidVersionError) invalid version: "foo"
Expand All @@ -60,10 +60,10 @@ defmodule GitHubActions.Versions do
** (ArgumentError) latest/1 expected a list or table of versions or a key, got: [a: "1"]
iex> Versions.latest(:elixir)
#Version<1.16.2>
%GitHubActions.Version{major: 1, minor: 17, patch: 1}
iex> Versions.latest(:otp)
#Version<26.2>
%GitHubActions.Version{major: 27, minor: 0}
"""
@spec latest(versions() | key()) :: Version.t()
def latest(versions_or_key) when is_list(versions_or_key) do
Expand Down Expand Up @@ -91,7 +91,7 @@ defmodule GitHubActions.Versions do
...> [a: ["1.0.0/2"], b: ["1.0.0/3"]],
...> [a: ["1.1.0/3"], b: ["1.1.0/4"]]
...> ], :a)
#Version<1.1.3>
%GitHubActions.Version{major: 1, minor: 1, patch: 3}
iex> Versions.latest([a: "1"], :a)
** (ArgumentError) latest/1 expected a table of versions, got: [a: "1"]
Expand Down Expand Up @@ -148,15 +148,15 @@ defmodule GitHubActions.Versions do
iex> Enum.map(minor_versions, &to_string/1)
["1.0.5", "1.1.1", "1.2.6", "1.3.4", "1.4.5", "1.5.3", "1.6.6", "1.7.4",
"1.8.2", "1.9.4", "1.10.4", "1.11.4", "1.12.3", "1.13.4", "1.14.5",
"1.15.7", "1.16.2"]
"1.15.8", "1.16.3", "1.17.1"]
iex> minor_versions = Versions.latest_minor(:otp)
iex> Enum.map(minor_versions, &to_string/1)
["17.0", "17.1", "17.2", "17.3", "17.4", "17.5", "18.0", "18.1", "18.2",
"18.3", "19.0", "19.1", "19.2", "19.3", "20.0", "20.1", "20.2", "20.3",
"21.0", "21.1", "21.2", "21.3", "22.0", "22.1", "22.2", "22.3", "23.0",
"23.1", "23.2", "23.3", "24.0", "24.1", "24.2", "24.3", "25.0", "25.1",
"25.2", "25.3", "26.0", "26.1", "26.2"]
"25.2", "25.3", "26.0", "26.1", "26.2", "27.0"]
"""
@spec latest_minor(versions_list() | key()) :: [Version.t()]
def latest_minor(versions_or_key) when is_list(versions_or_key) do
Expand Down Expand Up @@ -240,11 +240,11 @@ defmodule GitHubActions.Versions do
iex> major_versions = Versions.latest_major(:elixir)
iex> Enum.map(major_versions, &to_string/1)
["1.16.2"]
["1.17.1"]
iex> major_versions = Versions.latest_major(:otp)
iex> Enum.map(major_versions, &to_string/1)
["17.5", "18.3", "19.3", "20.3", "21.3", "22.3", "23.3", "24.3", "25.3", "26.2"]
["17.5", "18.3", "19.3", "20.3", "21.3", "22.3", "23.3", "24.3", "25.3", "26.2", "27.0"]
"""
@spec latest_major(versions_list() | key()) :: [Version.t()]
def latest_major(versions_or_key) when is_list(versions_or_key) do
Expand Down Expand Up @@ -304,7 +304,7 @@ defmodule GitHubActions.Versions do
...> ]
iex> versions = Versions.get(versions, :b)
iex> hd versions
#Version<1.0>
%GitHubActions.Version{major: 1, minor: 0}
iex> Enum.map(versions, &to_string/1)
["1.0", "1.1", "1.2", "2.0"]
Expand Down Expand Up @@ -655,21 +655,29 @@ defmodule GitHubActions.Versions do
iex> matrix = Versions.matrix(elixir: ">= 1.12.0", otp: ">= 22.0.0")
iex> Enum.map(matrix[:elixir], &to_string/1)
["1.12.3", "1.13.4", "1.14.5", "1.15.7", "1.16.2"]
["1.12.3", "1.13.4", "1.14.5", "1.15.8", "1.16.3", "1.17.1"]
iex> Enum.map(matrix[:otp], &to_string/1)
["22.3", "23.3", "24.3", "25.3", "26.2"]
["22.3", "23.3", "24.3", "25.3", "26.2", "27.0"]
iex> for [{k1, v1}, {k2, v2}] <- matrix[:exclude] do
...> [{k1, to_string(v1)}, {k2, to_string(v2)}]
...> end
[
[elixir: "1.12.3", otp: "25.3"],
[elixir: "1.12.3", otp: "26.2"],
[elixir: "1.12.3", otp: "27.0"],
[elixir: "1.13.4", otp: "26.2"],
[elixir: "1.13.4", otp: "27.0"],
[elixir: "1.14.5", otp: "22.3"],
[elixir: "1.15.7", otp: "22.3"],
[elixir: "1.15.7", otp: "23.3"],
[elixir: "1.16.2", otp: "22.3"],
[elixir: "1.16.2", otp: "23.3"]
[elixir: "1.14.5", otp: "27.0"],
[elixir: "1.15.8", otp: "22.3"],
[elixir: "1.15.8", otp: "23.3"],
[elixir: "1.15.8", otp: "27.0"],
[elixir: "1.16.3", otp: "22.3"],
[elixir: "1.16.3", otp: "23.3"],
[elixir: "1.16.3", otp: "27.0"],
[elixir: "1.17.1", otp: "22.3"],
[elixir: "1.17.1", otp: "23.3"],
[elixir: "1.17.1", otp: "24.3"]
]
iex> Versions.matrix([], elixir: ">= 1.9.0", otp: ">= 22.0.0")
Expand Down
4 changes: 2 additions & 2 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ defmodule GitHubActions.MixProject do
def project do
[
app: :git_hub_actions,
version: "0.2.22",
elixir: "~> 1.11",
version: "0.2.23",
elixir: "~> 1.13",
name: "GitHubActions",
description: "A little tool to write GitHub actions in Elixir",
source_url: @github,
Expand Down
10 changes: 5 additions & 5 deletions mix.lock
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
%{
"bunt": {:hex, :bunt, "1.0.0", "081c2c665f086849e6d57900292b3a161727ab40431219529f13c4ddcf3e7a44", [:mix], [], "hexpm", "dc5f86aa08a5f6fa6b8096f0735c4e76d54ae5c9fa2c143e5a1fc7c1cd9bb6b5"},
"credo": {:hex, :credo, "1.7.6", "b8f14011a5443f2839b04def0b252300842ce7388f3af177157c86da18dfbeea", [: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", "146f347fb9f8cbc5f7e39e3f22f70acbef51d441baa6d10169dd604bfbc55296"},
"credo": {:hex, :credo, "1.7.7", "771445037228f763f9b2afd612b6aa2fd8e28432a95dbbc60d8e03ce71ba4446", [: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", "8bc87496c9aaacdc3f90f01b7b0582467b69b4bd2441fe8aae3109d843cc2f2e"},
"dialyxir": {:hex, :dialyxir, "1.4.3", "edd0124f358f0b9e95bfe53a9fcf806d615d8f838e2202a9f430d59566b6b53b", [:mix], [{:erlex, ">= 0.2.6", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "bf2cfb75cd5c5006bec30141b131663299c661a864ec7fbbc72dfa557487a986"},
"earmark_parser": {:hex, :earmark_parser, "1.4.39", "424642f8335b05bb9eb611aa1564c148a8ee35c9c8a8bba6e129d51a3e3c6769", [:mix], [], "hexpm", "06553a88d1f1846da9ef066b87b57c6f605552cfbe40d20bd8d59cc6bde41944"},
"erlex": {:hex, :erlex, "0.2.6", "c7987d15e899c7a2f34f5420d2a2ea0d659682c06ac607572df55a43753aa12e", [:mix], [], "hexpm", "2ed2e25711feb44d52b17d2780eabf998452f6efda104877a3881c2f8c0c0c75"},
"erlex": {:hex, :erlex, "0.2.7", "810e8725f96ab74d17aac676e748627a07bc87eb950d2b83acd29dc047a30595", [:mix], [], "hexpm", "3ed95f79d1a844c3f6bf0cea61e0d5612a42ce56da9c03f01df538685365efb0"},
"escape": {:hex, :escape, "0.1.0", "548edab75e6e6938b1e199ef59cb8e504bcfd3bcf83471d4ae9a3c7a7a3c7d45", [:mix], [], "hexpm", "a5d8e92db4677155df54bc1306d401b5233875d570d474201db03cb3047491cd"},
"ex_doc": {:hex, :ex_doc, "0.33.0", "690562b153153c7e4d455dc21dab86e445f66ceba718defe64b0ef6f0bd83ba0", [:mix], [{:earmark_parser, "~> 1.4.39", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_c, ">= 0.1.0", [hex: :makeup_c, repo: "hexpm", optional: true]}, {:makeup_elixir, "~> 0.14 or ~> 1.0", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1 or ~> 1.0", [hex: :makeup_erlang, repo: "hexpm", optional: false]}, {:makeup_html, ">= 0.1.0", [hex: :makeup_html, repo: "hexpm", optional: true]}], "hexpm", "3f69adc28274cb51be37d09b03e4565232862a4b10288a3894587b0131412124"},
"ex_doc": {:hex, :ex_doc, "0.34.1", "9751a0419bc15bc7580c73fde506b17b07f6402a1e5243be9e0f05a68c723368", [:mix], [{:earmark_parser, "~> 1.4.39", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_c, ">= 0.1.0", [hex: :makeup_c, repo: "hexpm", optional: true]}, {:makeup_elixir, "~> 0.14 or ~> 1.0", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1 or ~> 1.0", [hex: :makeup_erlang, repo: "hexpm", optional: false]}, {:makeup_html, ">= 0.1.0", [hex: :makeup_html, repo: "hexpm", optional: true]}], "hexpm", "d441f1a86a235f59088978eff870de2e815e290e44a8bd976fe5d64470a4c9d2"},
"excoveralls": {:hex, :excoveralls, "0.18.1", "a6f547570c6b24ec13f122a5634833a063aec49218f6fff27de9df693a15588c", [:mix], [{:castore, "~> 1.0", [hex: :castore, repo: "hexpm", optional: true]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "d65f79db146bb20399f23046015974de0079668b9abb2f5aac074d078da60b8d"},
"file_system": {:hex, :file_system, "1.0.0", "b689cc7dcee665f774de94b5a832e578bd7963c8e637ef940cd44327db7de2cd", [:mix], [], "hexpm", "6752092d66aec5a10e662aefeed8ddb9531d79db0bc145bb8c40325ca1d8536d"},
"glob_ex": {:hex, :glob_ex, "0.1.7", "eae6b6377147fb712ac45b360e6dbba00346689a87f996672fe07e97d70597b1", [:mix], [], "hexpm", "decc1c21c0c73df3c9c994412716345c1692477b9470e337f628a7e08da0da6a"},
Expand All @@ -18,7 +18,7 @@
"nimble_parsec": {:hex, :nimble_parsec, "1.4.0", "51f9b613ea62cfa97b25ccc2c1b4216e81df970acd8e16e8d1bdc58fef21370d", [:mix], [], "hexpm", "9c565862810fb383e9838c1dd2d7d2c437b3d13b267414ba6af33e50d2d1cf28"},
"prove": {:hex, :prove, "0.1.7", "bdde734bcb438dddbef25084467125c82c551463d2666ba413d7e034afe44e12", [:mix], [], "hexpm", "59cc22688d3f5c503d4c3fc122cc3f95eca44abc5ac586bd975220bc18387cc2"},
"recode": {:hex, :recode, "0.7.2", "aa24873b6eb4c90e635ad1f7e12b8e21575a087698bd6bda6e72a82c1298eca1", [:mix], [{:escape, "~> 0.1", [hex: :escape, repo: "hexpm", optional: false]}, {:glob_ex, "~> 0.1", [hex: :glob_ex, repo: "hexpm", optional: false]}, {:rewrite, "~> 0.9", [hex: :rewrite, repo: "hexpm", optional: false]}], "hexpm", "d70fc60aae3c42781ec845515c1ddd4fe55218ed3fd8fe52267d338044ec7fb8"},
"rewrite": {:hex, :rewrite, "0.10.1", "238073297d122dad6b5501d761cb3bc0ce5bb4ab86e34c826c395f5f44b2f562", [:mix], [{:glob_ex, "~> 0.1", [hex: :glob_ex, repo: "hexpm", optional: false]}, {:sourceror, "~> 1.0", [hex: :sourceror, repo: "hexpm", optional: false]}], "hexpm", "91f8d6fe363033e8ff60097bb5e0b76867667df0b4d67e79c2850444c02d8b19"},
"sourceror": {:hex, :sourceror, "1.2.1", "b415255ad8bd05f0e859bb3d7ea617f6c2a4a405f2a534a231f229bd99b89f8b", [:mix], [], "hexpm", "e4d97087e67584a7585b5fe3d5a71bf8e7332f795dd1a44983d750003d5e750c"},
"rewrite": {:hex, :rewrite, "0.10.5", "6afadeae0b9d843b27ac6225e88e165884875e0aed333ef4ad3bf36f9c101bed", [:mix], [{:glob_ex, "~> 0.1", [hex: :glob_ex, repo: "hexpm", optional: false]}, {:sourceror, "~> 1.0", [hex: :sourceror, repo: "hexpm", optional: false]}], "hexpm", "51cc347a4269ad3a1e7a2c4122dbac9198302b082f5615964358b4635ebf3d4f"},
"sourceror": {:hex, :sourceror, "1.3.0", "70ab9e8bf6df085a1effba4b49ad621b7153b065f69ef6cdb82e6088f2026029", [:mix], [], "hexpm", "1794c3ceeca4eb3f9437261721e4d9cbf846d7c64c7aee4f64062b18d5ce1eac"},
"yamerl": {:hex, :yamerl, "0.10.0", "4ff81fee2f1f6a46f1700c0d880b24d193ddb74bd14ef42cb0bcf46e81ef2f8e", [:rebar3], [], "hexpm", "346adb2963f1051dc837a2364e4acf6eb7d80097c0f53cbdc3046ec8ec4b4e6e"},
}
Loading

0 comments on commit 63c33a7

Please sign in to comment.