diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 24902ac..0b0c396 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 }} @@ -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 @@ -79,7 +74,7 @@ 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 @@ -87,20 +82,20 @@ jobs: - 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') }} diff --git a/lib/git_hub_actions/project.ex b/lib/git_hub_actions/project.ex index 2ea298a..e3e832a 100644 --- a/lib/git_hub_actions/project.ex +++ b/lib/git_hub_actions/project.ex @@ -15,7 +15,7 @@ defmodule GitHubActions.Project do ## Examples iex> Project.elixir() - "~> 1.11" + "~> 1.13" """ @spec elixir :: String.t() def elixir do diff --git a/lib/git_hub_actions/version.ex b/lib/git_hub_actions/version.ex index 287a9ed..15057f1 100644 --- a/lib/git_hub_actions/version.ex +++ b/lib/git_hub_actions/version.ex @@ -36,7 +36,7 @@ defmodule GitHubActions.Version do "!" ] @fields [:major, :minor, :patch] - + @derive {Inspect, optional: [:minor, :patch]} defstruct @fields @type version :: String.t() | t @@ -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 @@ -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" @@ -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] diff --git a/lib/git_hub_actions/versions.ex b/lib/git_hub_actions/versions.ex index f3a63cf..c08361a 100644 --- a/lib/git_hub_actions/versions.ex +++ b/lib/git_hub_actions/versions.ex @@ -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()) @@ -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" @@ -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 @@ -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"] @@ -148,7 +148,7 @@ 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) @@ -156,7 +156,7 @@ defmodule GitHubActions.Versions do "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 @@ -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 @@ -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"] @@ -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") diff --git a/mix.exs b/mix.exs index 30ae013..625da13 100644 --- a/mix.exs +++ b/mix.exs @@ -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, diff --git a/mix.lock b/mix.lock index f7d9cd3..9815e4c 100644 --- a/mix.lock +++ b/mix.lock @@ -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"}, @@ -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"}, } diff --git a/priv/config.exs b/priv/config.exs index e554e35..4518cd9 100644 --- a/priv/config.exs +++ b/priv/config.exs @@ -117,8 +117,8 @@ config versions: [ "1.12.0/3", "1.13.0/4", "1.14.0/5", - "1.15.0/7", - "1.16.0/2" + "1.15.0/8", + "1.16.0/3" ] ], [ @@ -126,16 +126,24 @@ config versions: [ elixir: [ "1.13.4", "1.14.0/5", - "1.15.0/7", - "1.16.0/2" + "1.15.0/8", + "1.16.0/3", + "1.17.0/1" ] ], [ otp: ["26.0/2"], elixir: [ "1.14.5", - "1.15.0/7", - "1.16.0/2" + "1.15.0/8", + "1.16.0/3", + "1.17.0/1" + ] + ], + [ + otp: ["27.0"], + elixir: [ + "1.17.0/1" ] ] ] diff --git a/test/fixtures/default.yml b/test/fixtures/default.yml index 24902ac..0b0c396 100644 --- a/test/fixtures/default.yml +++ b/test/fixtures/default.yml @@ -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 }} @@ -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 @@ -79,7 +74,7 @@ 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 @@ -87,20 +82,20 @@ jobs: - 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') }} diff --git a/test/fixtures/global_default.yml b/test/fixtures/global_default.yml index 24902ac..0b0c396 100644 --- a/test/fixtures/global_default.yml +++ b/test/fixtures/global_default.yml @@ -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 }} @@ -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 @@ -79,7 +74,7 @@ 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 @@ -87,20 +82,20 @@ jobs: - 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') }} diff --git a/test/fixtures/macos.yml b/test/fixtures/macos.yml index 0c57450..40d92bf 100644 --- a/test/fixtures/macos.yml +++ b/test/fixtures/macos.yml @@ -35,7 +35,7 @@ jobs: run: MIX_ENV=test mix compile --warnings-as-errors - 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') }} diff --git a/test/fixtures/no_comment.yml b/test/fixtures/no_comment.yml index d8895d2..69173c4 100644 --- a/test/fixtures/no_comment.yml +++ b/test/fixtures/no_comment.yml @@ -11,50 +11,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 @@ -78,7 +73,7 @@ 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 @@ -86,20 +81,20 @@ jobs: - 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') }} diff --git a/test/fixtures/opt_output.yml b/test/fixtures/opt_output.yml index 24902ac..0b0c396 100644 --- a/test/fixtures/opt_output.yml +++ b/test/fixtures/opt_output.yml @@ -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 }} @@ -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 @@ -79,7 +74,7 @@ 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 @@ -87,20 +82,20 @@ jobs: - 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') }} diff --git a/test/fixtures/opt_workflow.yml b/test/fixtures/opt_workflow.yml index 24e3809..ab21641 100644 --- a/test/fixtures/opt_workflow.yml +++ b/test/fixtures/opt_workflow.yml @@ -1,2 +1,2 @@ -# Created with GitHubActions version 0.2.22 +# Created with GitHubActions version 0.2.23 name: CI diff --git a/test/fixtures/windows.yml b/test/fixtures/windows.yml index 8d22411..fdc60bc 100644 --- a/test/fixtures/windows.yml +++ b/test/fixtures/windows.yml @@ -14,8 +14,8 @@ jobs: - name: Setup Elixir uses: erlef/setup-beam@v1 with: - elixir-version: '1.16.2' - otp-version: '26.2' + elixir-version: '1.17.1' + otp-version: '27.0' - name: Get dependencies run: mix deps.get - name: Compile dependencies diff --git a/test/git_hub_actions/versions_test.exs b/test/git_hub_actions/versions_test.exs index bacca04..3de94a7 100644 --- a/test/git_hub_actions/versions_test.exs +++ b/test/git_hub_actions/versions_test.exs @@ -19,7 +19,7 @@ defmodule GitHubActions.VersionsTest do test "from_config/0" do assert List.last(Versions.from_config()) == - [otp: ["26.0/2"], elixir: ["1.14.5", "1.15.0/7", "1.16.0/2"]] + [otp: ["27.0"], elixir: ["1.17.0/1"]] end describe "get/2" do @@ -115,7 +115,7 @@ defmodule GitHubActions.VersionsTest do "1.14.3", "1.14.4", "1.14.5", - # v1.15.0/7 + # v1.15.0/8 "1.15.0", "1.15.1", "1.15.2", @@ -124,10 +124,15 @@ defmodule GitHubActions.VersionsTest do "1.15.5", "1.15.6", "1.15.7", - # v1.16.0/1 + "1.15.8", + # v1.16.0/3 "1.16.0", "1.16.1", - "1.16.2" + "1.16.2", + "1.16.3", + # v1.17.0/1 + "1.17.0", + "1.17.1" ] end @@ -174,7 +179,8 @@ defmodule GitHubActions.VersionsTest do "25.3", "26.0", "26.1", - "26.2" + "26.2", + "27.0" ] end end @@ -269,9 +275,13 @@ defmodule GitHubActions.VersionsTest do %Version{major: 1, minor: 15, patch: 5}, %Version{major: 1, minor: 15, patch: 6}, %Version{major: 1, minor: 15, patch: 7}, + %Version{major: 1, minor: 15, patch: 8}, %Version{major: 1, minor: 16, patch: 0}, %Version{major: 1, minor: 16, patch: 1}, - %Version{major: 1, minor: 16, patch: 2} + %Version{major: 1, minor: 16, patch: 2}, + %Version{major: 1, minor: 16, patch: 3}, + %Version{major: 1, minor: 17, patch: 0}, + %Version{major: 1, minor: 17, patch: 1} ] end @@ -306,8 +316,9 @@ defmodule GitHubActions.VersionsTest do %Version{major: 1, minor: 12, patch: 3}, %Version{major: 1, minor: 13, patch: 4}, %Version{major: 1, minor: 14, patch: 5}, - %Version{major: 1, minor: 15, patch: 7}, - %Version{major: 1, minor: 16, patch: 2} + %Version{major: 1, minor: 15, patch: 8}, + %Version{major: 1, minor: 16, patch: 3}, + %Version{major: 1, minor: 17, patch: 1} ] end end @@ -324,7 +335,8 @@ defmodule GitHubActions.VersionsTest do %Version{major: 23, minor: 3}, %Version{major: 24, minor: 3}, %Version{major: 25, minor: 3}, - %Version{major: 26, minor: 2} + %Version{major: 26, minor: 2}, + %Version{major: 27, minor: 0} ] end end @@ -425,19 +437,31 @@ defmodule GitHubActions.VersionsTest do ], [ otp: %Version{major: 22, minor: 3}, - elixir: %Version{major: 1, minor: 15, patch: 7} + elixir: %Version{major: 1, minor: 15, patch: 8} + ], + [ + otp: %Version{major: 22, minor: 3}, + elixir: %Version{major: 1, minor: 16, patch: 3} ], [ otp: %Version{major: 22, minor: 3}, - elixir: %Version{major: 1, minor: 16, patch: 2} + elixir: %Version{major: 1, minor: 17, patch: 1} ], [ otp: %Version{major: 23, minor: 3}, - elixir: %Version{major: 1, minor: 15, patch: 7} + elixir: %Version{major: 1, minor: 15, patch: 8} ], [ otp: %Version{major: 23, minor: 3}, - elixir: %Version{major: 1, minor: 16, patch: 2} + elixir: %Version{major: 1, minor: 16, patch: 3} + ], + [ + otp: %Version{major: 23, minor: 3}, + elixir: %Version{major: 1, minor: 17, patch: 1} + ], + [ + otp: %Version{major: 24, minor: 3}, + elixir: %Version{major: 1, minor: 17, patch: 1} ], [ otp: %Version{major: 25, minor: 3}, @@ -450,6 +474,26 @@ defmodule GitHubActions.VersionsTest do [ otp: %Version{major: 26, minor: 2}, elixir: %Version{major: 1, minor: 13, patch: 4} + ], + [ + otp: %Version{major: 27, minor: 0}, + elixir: %Version{major: 1, minor: 12, patch: 3} + ], + [ + otp: %Version{major: 27, minor: 0}, + elixir: %Version{major: 1, minor: 13, patch: 4} + ], + [ + otp: %Version{major: 27, minor: 0}, + elixir: %Version{major: 1, minor: 14, patch: 5} + ], + [ + otp: %Version{major: 27, minor: 0}, + elixir: %Version{major: 1, minor: 15, patch: 8} + ], + [ + otp: %Version{major: 27, minor: 0}, + elixir: %Version{major: 1, minor: 16, patch: 3} ] ] end diff --git a/test/git_hub_actions/workflow_test.exs b/test/git_hub_actions/workflow_test.exs index 07f82d9..2d1216f 100644 --- a/test/git_hub_actions/workflow_test.exs +++ b/test/git_hub_actions/workflow_test.exs @@ -35,51 +35,65 @@ defmodule GitHubActions.WorkflowTest do prove "workflow matrix", Workflow.eval("test/fixtures/workflow_matrix.exs") == - {:ok, - [ - name: "CI", - env: [GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"], - jobs: [ - linux: [ - name: "Test on Ubuntu (Elixir ${{ matrix.elixir }}, OTP ${{ matrix.otp }})", - "runs-on": "ubuntu-20.04", - strategy: [ - matrix: [ - elixir: [ - "1.10.4", - "1.11.4", - "1.12.3", - "1.13.4", - "1.14.5", - "1.15.7", - "1.16.2" - ], - otp: ["21.3", "22.3", "23.3", "24.3", "25.3", "26.2"], - exclude: [ - [elixir: "1.10.4", otp: "24.3"], - [elixir: "1.10.4", otp: "25.3"], - [elixir: "1.10.4", otp: "26.2"], - [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.14.5", otp: "21.3"], - [elixir: "1.14.5", otp: "22.3"], - [elixir: "1.15.7", otp: "21.3"], - [elixir: "1.15.7", otp: "22.3"], - [elixir: "1.15.7", otp: "23.3"], - [elixir: "1.16.2", otp: "21.3"], - [elixir: "1.16.2", otp: "22.3"], - [elixir: "1.16.2", otp: "23.3"] - ] - ] - ] - ] - ] - ]} + { + :ok, + [ + name: "CI", + env: [GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"], + jobs: [ + linux: [ + name: "Test on Ubuntu (Elixir ${{ matrix.elixir }}, OTP ${{ matrix.otp }})", + "runs-on": "ubuntu-20.04", + strategy: [ + matrix: [ + elixir: [ + "1.10.4", + "1.11.4", + "1.12.3", + "1.13.4", + "1.14.5", + "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.10.4", otp: "24.3"], + [elixir: "1.10.4", otp: "25.3"], + [elixir: "1.10.4", otp: "26.2"], + [elixir: "1.10.4", otp: "27.0"], + [elixir: "1.11.4", otp: "25.3"], + [elixir: "1.11.4", otp: "26.2"], + [elixir: "1.11.4", otp: "27.0"], + [elixir: "1.12.3", otp: "21.3"], + [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: "21.3"], + [elixir: "1.13.4", otp: "26.2"], + [elixir: "1.13.4", otp: "27.0"], + [elixir: "1.14.5", otp: "21.3"], + [elixir: "1.14.5", otp: "22.3"], + [elixir: "1.14.5", otp: "27.0"], + [elixir: "1.15.8", otp: "21.3"], + [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: "21.3"], + [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: "21.3"], + [elixir: "1.17.1", otp: "22.3"], + [elixir: "1.17.1", otp: "23.3"], + [elixir: "1.17.1", otp: "24.3"] + ] + ] + ] + ] + ] + ] + } prove "workflow steps", Workflow.eval("test/fixtures/workflow_steps.exs") == @@ -104,150 +118,122 @@ defmodule GitHubActions.WorkflowTest do prove "default workflow", Workflow.eval("priv/default.exs") == - {:ok, - [ - name: "CI", - env: [GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"], - on: ["pull_request", "push"], - jobs: [ - linux: [ - name: """ - Test on Ubuntu (\ - Elixir ${{ matrix.elixir }}, \ - OTP ${{ matrix.otp }})\ - """, - "runs-on": "ubuntu-20.04", - strategy: [ - matrix: [ - elixir: ["1.11.4", "1.12.3", "1.13.4", "1.14.5", "1.15.7", "1.16.2"], - otp: ["21.3", "22.3", "23.3", "24.3", "25.3", "26.2"], - 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.14.5", otp: "21.3"], - [elixir: "1.14.5", otp: "22.3"], - [elixir: "1.15.7", otp: "21.3"], - [elixir: "1.15.7", otp: "22.3"], - [elixir: "1.15.7", otp: "23.3"], - [elixir: "1.16.2", otp: "21.3"], - [elixir: "1.16.2", otp: "22.3"], - [elixir: "1.16.2", otp: "23.3"] - ] - ] - ], - steps: [ - [ - name: "Checkout", - uses: "actions/checkout@v4" - ], - [ - name: "Setup Elixir", - uses: "erlef/setup-beam@v1", - with: [ - "elixir-version": "${{ matrix.elixir }}", - "otp-version": "${{ matrix.otp }}" - ] - ], - [ - name: "Restore deps", - uses: "actions/cache@v4", - with: [ - path: "deps", - key: """ - deps-\ - ${{ runner.os }}-\ - ${{ matrix.elixir }}-\ - ${{ matrix.otp }}-\ - ${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}\ - """ - ] - ], - [ - name: "Restore _build", - uses: "actions/cache@v4", - with: [ - path: "_build", - key: """ - _build-\ - ${{ runner.os }}-\ - ${{ matrix.elixir }}-\ - ${{ matrix.otp }}-\ - ${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}\ - """ - ] - ], - [ - name: "Restore test/support/plts", - uses: "actions/cache@v4", - 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') }}" - ], - [ - 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') }}", - run: "mix deps.unlock --check-unused" - ], - [ - name: "Check code format", - if: - "${{ contains(matrix.elixir, '1.16.2') && contains(matrix.otp, '26.2') }}", - run: "mix format --check-formatted" - ], - [ - name: "Lint code", - if: - "${{ contains(matrix.elixir, '1.16.2') && contains(matrix.otp, '26.2') }}", - run: "mix credo --strict" - ], - [ - {:name, "Run tests"}, - {:run, "mix test"}, - {:if, - "${{ !(contains(matrix.elixir, '1.16.2') && contains(matrix.otp, '26.2')) }}"} - ], - [ - name: "Run tests with coverage", - run: "mix coveralls.github", - if: - "${{ contains(matrix.elixir, '1.16.2') && contains(matrix.otp, '26.2') }}" - ], - [ - name: "Static code analysis", - run: "mix dialyzer --format github --force-check", - if: - "${{ contains(matrix.elixir, '1.16.2') && contains(matrix.otp, '26.2') }}" - ] - ] - ] - ] - ]} + { + :ok, + [ + name: "CI", + env: [GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"], + on: ["pull_request", "push"], + jobs: [ + linux: [ + name: "Test on Ubuntu (Elixir ${{ matrix.elixir }}, OTP ${{ matrix.otp }})", + "runs-on": "ubuntu-20.04", + strategy: [ + matrix: [ + elixir: ["1.13.4", "1.14.5", "1.15.8", "1.16.3", "1.17.1"], + otp: ["22.3", "23.3", "24.3", "25.3", "26.2", "27.0"], + exclude: [ + [elixir: "1.13.4", otp: "26.2"], + [elixir: "1.13.4", otp: "27.0"], + [elixir: "1.14.5", otp: "22.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"] + ] + ] + ], + steps: [ + [name: "Checkout", uses: "actions/checkout@v4"], + [ + name: "Setup Elixir", + uses: "erlef/setup-beam@v1", + with: [ + "elixir-version": "${{ matrix.elixir }}", + "otp-version": "${{ matrix.otp }}" + ] + ], + [ + name: "Restore deps", + uses: "actions/cache@v4", + with: [ + path: "deps", + key: + "deps-${{ runner.os }}-${{ matrix.elixir }}-${{ matrix.otp }}-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}" + ] + ], + [ + name: "Restore _build", + uses: "actions/cache@v4", + with: [ + path: "_build", + key: + "_build-${{ runner.os }}-${{ matrix.elixir }}-${{ matrix.otp }}-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}" + ] + ], + [ + name: "Restore test/support/plts", + uses: "actions/cache@v4", + 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.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.17.1') && contains(matrix.otp, '27.0') }}", + run: "mix deps.unlock --check-unused" + ], + [ + name: "Check code format", + 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.17.1') && contains(matrix.otp, '27.0') }}", + run: "mix credo --strict" + ], + [ + name: "Run tests", + run: "mix test", + 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.17.1') && contains(matrix.otp, '27.0') }}" + ], + [ + name: "Static code analysis", + run: "mix dialyzer --format github --force-check", + if: + "${{ contains(matrix.elixir, '1.17.1') && contains(matrix.otp, '27.0') }}" + ] + ] + ] + ] + ] + } end end