diff --git a/.github/workflows/elixir.yml b/.github/workflows/elixir.yml index 08ca75da..04067ba6 100644 --- a/.github/workflows/elixir.yml +++ b/.github/workflows/elixir.yml @@ -7,25 +7,28 @@ on: pull_request: branches: [ master ] +permissions: + contents: read + jobs: build: name: Build and test - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 steps: - - uses: actions/checkout@v2 - - name: System dependencies + - uses: actions/checkout@v4 + - name: Install inotify-tools run: | - sudo apt update - sudo apt install -y inotify-tools + sudo apt-get update + sudo apt-get install inotify-tools - name: Set up Elixir - uses: erlef/setup-beam@988e02bfe678367a02564f65ca2e37726dc0268f + uses: erlef/setup-beam@v1.18 with: - elixir-version: '1.12.3' # Define the elixir version [required] - otp-version: '24.1' # Define the OTP version [required] + elixir-version: '1.17' # [Required] Define the Elixir version + otp-version: '27.0' # [Required] Define the Erlang/OTP version - name: Restore dependencies cache - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: deps key: ${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }} @@ -34,5 +37,5 @@ jobs: run: mix deps.get - name: Run tests run: mix test - - name: Run static analytics + - name: Run static analysis run: mix credo suggest --all --strict diff --git a/lib/koans/03_numbers.ex b/lib/koans/03_numbers.ex index 9fb3ab23..d7d73e14 100644 --- a/lib/koans/03_numbers.ex +++ b/lib/koans/03_numbers.ex @@ -124,11 +124,11 @@ defmodule Numbers do assert 0 in range == ___ end - def is_range?(%Range{}), do: true - def is_range?(_), do: false + def range?(%Range{}), do: true + def range?(_), do: false koan "Is this a range?" do - assert is_range?(1..10) == ___ - assert is_range?(0) == ___ + assert range?(1..10) == ___ + assert range?(0) == ___ end end diff --git a/mix.exs b/mix.exs index de880795..32154323 100644 --- a/mix.exs +++ b/mix.exs @@ -15,7 +15,7 @@ defmodule Koans.Mixfile do end defp deps do - [{:file_system, "~> 0.2"}, + [{:file_system, "~> 1.0"}, {:credo, "~> 1.7", only: [:dev, :test], runtime: false}] end diff --git a/mix.lock b/mix.lock index 3acd1054..56b6c60f 100644 --- a/mix.lock +++ b/mix.lock @@ -1,6 +1,6 @@ %{ - "bunt": {:hex, :bunt, "0.2.1", "e2d4792f7bc0ced7583ab54922808919518d0e57ee162901a16a1b6664ef3b14", [:mix], [], "hexpm", "a330bfb4245239787b15005e66ae6845c9cd524a288f0d141c148b02603777a5"}, - "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"}, - "file_system": {:hex, :file_system, "0.2.10", "fb082005a9cd1711c05b5248710f8826b02d7d1784e7c3451f9c1231d4fc162d", [:mix], [], "hexpm", "41195edbfb562a593726eda3b3e8b103a309b733ad25f3d642ba49696bf715dc"}, - "jason": {:hex, :jason, "1.4.1", "af1504e35f629ddcdd6addb3513c3853991f694921b1b9368b0bd32beb9f1b63", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "fbb01ecdfd565b56261302f7e1fcc27c4fb8f32d56eab74db621fc154604a7a1"}, + "bunt": {:hex, :bunt, "1.0.0", "081c2c665f086849e6d57900292b3a161727ab40431219529f13c4ddcf3e7a44", [:mix], [], "hexpm", "dc5f86aa08a5f6fa6b8096f0735c4e76d54ae5c9fa2c143e5a1fc7c1cd9bb6b5"}, + "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"}, + "file_system": {:hex, :file_system, "1.0.1", "79e8ceaddb0416f8b8cd02a0127bdbababe7bf4a23d2a395b983c1f8b3f73edd", [:mix], [], "hexpm", "4414d1f38863ddf9120720cd976fce5bdde8e91d8283353f0e31850fa89feb9e"}, + "jason": {:hex, :jason, "1.4.4", "b9226785a9aa77b6857ca22832cffa5d5011a667207eb2a0ad56adb5db443b8a", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "c5eb0cab91f094599f94d55bc63409236a8ec69a21a67814529e8d5f6cc90b3b"}, }