Skip to content

Commit

Permalink
Check absinthe dependent libraries on CI runs
Browse files Browse the repository at this point in the history
* Update elixir versions in CI to test 1.15, 1.16, and 1.17
* Update OTP version in CI to test 25, 26, and 27
* Update ubuntu version to 24.04
* Lower jaro_distance threshold slightly
* Remove else part of with expression in generate_schema. Dialyzer
  saw that Absinthe.Schema.introspect will only return
  {:error, String.t()} if there is an error
  • Loading branch information
bryanjos committed Jun 14, 2024
1 parent 1e02284 commit bba72db
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 24 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/check_dependents.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Check Dependents

on:
push:
pull_request:
branches:
- master

jobs:
test_dependents:
name: Ensure ${{ matrix.dependent }} tests pass
runs-on: ubuntu-24.04

strategy:
matrix:
dependent:
- 'absinthe_plug'
- 'absinthe_phoenix'
- 'absinthe_relay'

steps:
- name: Set up Elixir
uses: erlef/setup-beam@v1
with:
elixir-version: '1.17'
otp-version: '27'

- name: Checkout absinthe
uses: actions/checkout@v4

- name: Checkout ${{ matrix.dependent }}
uses: actions/checkout@v4
with:
repository: 'absinthe-graphql/${{ matrix.dependent }}'
path: '${{ matrix.dependent }}'

- name: Install absinthe package dependencies
run: mix deps.get

- name: Update absinthe dependency
run: 'sed -i -e "s|{:absinthe,.*|{:absinthe, path: \"$GITHUB_WORKSPACE\", override: true},|" mix.exs'
working-directory: ./${{ matrix.dependent }}

- name: Install ${{ matrix.dependent }} package dependencies
run: mix deps.get
working-directory: ./${{ matrix.dependent }}

- name: Run unit tests
run: |
mix clean
mix test
working-directory: ./${{ matrix.dependent }}
36 changes: 16 additions & 20 deletions .github/workflows/elixir.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,25 @@ on:
jobs:
test:
name: Elixir ${{matrix.elixir}} / OTP ${{matrix.otp}}
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04

strategy:
matrix:
elixir:
- "1.13"
- "1.14"
- "1.15"
- '1.15'
- '1.16'
- '1.17'
otp:
- "24"
- "25"
- "26"
include:
- elixir: "1.15"
otp: "26"
format: true
- '25'
- '26'
- '27'
exclude:
- otp: 26
elixir: 1.13
- otp: 26
elixir: 1.14
- otp: 25
elixir: 1.17
- otp: 27
elixir: 1.15
- otp: 27
elixir: 1.16

steps:
- name: Checkout
Expand Down Expand Up @@ -57,7 +55,6 @@ jobs:

- name: Check Formatting
run: mix format --check-formatted
if: ${{ matrix.format }}

- name: Run unit tests
run: |
Expand All @@ -77,10 +74,9 @@ jobs:
path: |
priv/plts
key: "v1-${{ runner.os }}-\
erlang-${{ matrix.otp }}-\
elixir-${{ matrix.elixir }}-\
${{ hashFiles('mix.lock') }}"
erlang-${{ matrix.otp }}-\
elixir-${{ matrix.elixir }}-\
${{ hashFiles('mix.lock') }}"

- name: Run Dialyzer
run: mix dialyzer

2 changes: 1 addition & 1 deletion lib/absinthe/utils/suggestion.ex
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
defmodule Absinthe.Utils.Suggestion do
@jaro_threshold 0.70
@jaro_threshold 0.68

@doc """
Sort a list of suggestions by Jaro distance to a target string,
Expand Down
3 changes: 0 additions & 3 deletions lib/mix/tasks/absinthe.schema.json.ex
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,6 @@ defmodule Mix.Tasks.Absinthe.Schema.Json do
with {:ok, result} <- Absinthe.Schema.introspect(schema) do
content = json_codec.encode!(result, pretty: pretty)
{:ok, content}
else
{:error, reason} -> {:error, reason}
error -> {:error, error}
end
end

Expand Down

0 comments on commit bba72db

Please sign in to comment.