Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Elixir CI workflow #292

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 13 additions & 10 deletions .github/workflows/elixir.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this was left as a old version to ensure some backwards compatibility with running the Koans on old Elixirs. I'm not sure how important that is presently, but what is your take? Should we consider a build matrix?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I think about this, I lean towards limiting CI to a more/most current Elixir release given that folks learning Elixir are likely to be using the latest. I'm not aware of situations where one would be limited to an old release, e.g. some computing limitation on the machine they're learning with. Thoughts?

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') }}
Expand All @@ -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
8 changes: 4 additions & 4 deletions lib/koans/03_numbers.ex
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
end

koan "I want the first and last in the range" do
first..last = Range.new(1, 10)

Check warning on line 113 in lib/koans/03_numbers.ex

View workflow job for this annotation

GitHub Actions / Build and test

first..last inside match is deprecated, you must always match on the step: first..last//var or first..last//_ if you want to ignore it

Check warning on line 113 in lib/koans/03_numbers.ex

View workflow job for this annotation

GitHub Actions / Build and test

first..last inside match is deprecated, you must always match on the step: first..last//var or first..last//_ if you want to ignore it

assert first == ___
assert last == ___
Expand All @@ -124,11 +124,11 @@
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
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 4 additions & 4 deletions mix.lock
Original file line number Diff line number Diff line change
@@ -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"},
}
Loading