Skip to content

Commit

Permalink
Support Elixir 1.18
Browse files Browse the repository at this point in the history
List of changes:
- add Elixir 1.18 to CI build matrix
- bump GitHub actions
- migrate Mix.Config to Config
- resolve test error with overriden field_constructor env value
- use shorter version in build matrix
  • Loading branch information
kianmeng committed Jan 3, 2025
1 parent ca12642 commit ab8760f
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 49 deletions.
44 changes: 25 additions & 19 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,34 @@ jobs:
matrix:
# https://hexdocs.pm/elixir/compatibility-and-deprecations.html
include:
- elixir-version: 1.17.x
otp-version: 27.x
- elixir-version: 1.17.x
otp-version: 26.x
- elixir-version: 1.17.x
otp-version: 25.x
- elixir-version: 1.16.x
otp-version: 26.x
- elixir-version: 1.16.x
otp-version: 25.x
- elixir-version: 1.15.x
otp-version: 26.x
- elixir-version: 1.15.x
otp-version: 25.x
- elixir-version: 1.14.x
otp-version: 25.x
- elixir-version: 1.13.x
otp-version: 24.x
- elixir-version: "1.18"
otp-version: "27"
- elixir-version: "1.18"
otp-version: "26"
- elixir-version: "1.18"
otp-version: "25"
- elixir-version: "1.17"
otp-version: "27"
- elixir-version: "1.17"
otp-version: "26"
- elixir-version: "1.17"
otp-version: "25"
- elixir-version: "1.16"
otp-version: "26"
- elixir-version: "1.16"
otp-version: "25"
- elixir-version: "1.15"
otp-version: "26"
- elixir-version: "1.15"
otp-version: "25"
- elixir-version: "1.14"
otp-version: "25"
- elixir-version: "1.13"
otp-version: "24"
env:
MIX_ENV: test
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: erlef/setup-beam@v1
with:
otp-version: ${{ matrix.otp-version }}
Expand Down
31 changes: 1 addition & 30 deletions config/config.exs
Original file line number Diff line number Diff line change
@@ -1,34 +1,5 @@
# This file is responsible for configuring your application
# and its dependencies with the aid of the Mix.Config module.
use Mix.Config
import Config

config :absinthe_error_payload,
ecto_repos: [],
field_constructor: AbsintheErrorPayload.FieldConstructor

# This configuration is loaded before any dependency and is restricted
# to this project. If another project depends on this project, this
# file won't be loaded nor affect the parent project. For this reason,
# if you want to provide default values for your application for
# 3rd-party users, it should be done in your "mix.exs" file.

# You can configure for your application as:
#
# config :absinthe_error_payload, key: :value
#
# And access this configuration in your application as:
#
# Application.get_env(:absinthe_error_payload, :key)
#
# Or configure a 3rd-party app:
#
# config :logger, level: :info
#

# It is also possible to import configuration files, relative to this
# directory. For example, you can emulate configuration per environment
# by uncommenting the line below and defining dev.exs, test.exs and such.
# Configuration from the imported file will override the ones defined
# here (which is why it is important to import them last).
#
# import_config "#{Mix.env}.exs"
5 changes: 5 additions & 0 deletions test/changeset_parser_custom_field_constructor_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,12 @@ defmodule AbsintheErrorPayload.ChangesetParserCustomFieldConstructorTest do
end

setup do
original_field_constructor = Application.get_env(:absinthe_error_payload, :field_constructor)
Application.put_env(:absinthe_error_payload, :field_constructor, CustomFieldConstructor)

on_exit(fn ->
Application.put_env(:absinthe_error_payload, :field_constructor, original_field_constructor)
end)
end

describe "construct_message/2" do
Expand Down

0 comments on commit ab8760f

Please sign in to comment.