From fbba4c243c23aa41e836d0392bf53b3c11e71b5d Mon Sep 17 00:00:00 2001 From: Andrea Leopardi Date: Tue, 26 Dec 2023 20:05:08 +0100 Subject: [PATCH] Fix CI on Elixir 1.10 (#1199) --- .github/workflows/ci.yml | 6 +++++- mix.exs | 8 +++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a97620cc..46a59bcc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,14 +32,18 @@ jobs: elixir-version: ${{ matrix.pair.elixir }} - name: Install dependencies + run: mix deps.get + + - name: Ensure mix.lock is up to date run: mix deps.get --check-locked + if: ${{ matrix.lint }} - name: Ensure that files are formatted run: mix format --check-formatted if: ${{ matrix.lint }} - name: Check for unused dependencies - run: mix do deps.get, deps.unlock --check-unused + run: mix deps.unlock --check-unused if: ${{ matrix.lint }} - name: Run tests diff --git a/mix.exs b/mix.exs index 01423133..d498f96a 100644 --- a/mix.exs +++ b/mix.exs @@ -45,12 +45,18 @@ defmodule Plug.MixProject do def deps do [ {:mime, "~> 1.0 or ~> 2.0"}, - {:plug_crypto, "~> 1.1.1 or ~> 1.2 or ~> 2.0"}, + {:plug_crypto, plug_crypto_version()}, {:telemetry, "~> 0.4.3 or ~> 1.0"}, {:ex_doc, "~> 0.21", only: :docs} ] end + if Version.match?(System.version(), "~> 1.10.0") do + defp plug_crypto_version, do: "~> 1.1.1 or ~> 1.2" + else + defp plug_crypto_version, do: "~> 1.1.1 or ~> 1.2 or ~> 2.0" + end + defp package do %{ licenses: ["Apache-2.0"],