Skip to content

Commit

Permalink
Support Elixir 1.18 in GitHub CI
Browse files Browse the repository at this point in the history
List of changes:
- resolve type warnings in test case
- use specific versions by string instead of number in CI matrix, see
  https://github.com/erlef/setup-beam?tab=readme-ov-file#specify-versions-as-strings-not-numbers
  • Loading branch information
kianmeng committed Jan 17, 2025
1 parent 0993bf5 commit ba319ee
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 27 deletions.
55 changes: 29 additions & 26 deletions .github/workflows/on-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,53 +11,56 @@ jobs:
matrix:
include:
- pair:
otp: 27.x
elixir: 1.17.x
lint: lint
otp: "27"
elixir: "1.18"
lint: lint
- pair:
otp: "27"
elixir: "1.17"

- pair:
otp: 26.x
elixir: 1.17.x
otp: "26"
elixir: "1.17"
- pair:
otp: 26.x
elixir: 1.16.x
otp: "26"
elixir: "1.16"
- pair:
otp: 26.x
elixir: 1.15.x
otp: "26"
elixir: "1.15"

- pair:
otp: 25.x
elixir: 1.17.x
otp: "25"
elixir: "1.17"
- pair:
otp: 25.x
elixir: 1.16.x
otp: "25"
elixir: "1.16"
- pair:
otp: 25.x
elixir: 1.15.x
otp: "25"
elixir: "1.15"
- pair:
otp: 25.x
elixir: 1.14.x
otp: "25"
elixir: "1.14"

- pair:
otp: 24.x
elixir: 1.16.x
otp: "24"
elixir: "1.16"
- pair:
otp: 24.x
elixir: 1.15.x
otp: "24"
elixir: "1.15"
- pair:
otp: 24.x
elixir: 1.14.x
otp: "24"
elixir: "1.14"
- pair:
otp: 24.x
elixir: 1.13.x
otp: "24"
elixir: "1.13"

steps:
- uses: actions/checkout@v4
- uses: erlef/setup-beam@v1
with:
otp-version: ${{matrix.pair.otp}}
elixir-version: ${{matrix.pair.elixir}}
- uses: actions/cache@v3
- uses: actions/cache@v4
with:
path: |
deps
Expand Down
8 changes: 7 additions & 1 deletion test/support/file_helpers.ex
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,13 @@ defmodule Support.FileHelpers do
Note: It doesn't appear this can be run with `use ExUnit.Case, async: true`
"""
defmacro in_tmp(fun) do
path = Path.join([tmp_path(), "#{__CALLER__.module}", "#{elem(__CALLER__.function, 0)}"])
fn_name =
case __CALLER__.function do
{fn_name, _arity} -> fn_name
_ -> "unknown"
end

path = Path.join([tmp_path(), "#{__CALLER__.module}", "#{fn_name}"])

quote do
path = unquote(path)
Expand Down

0 comments on commit ba319ee

Please sign in to comment.