Skip to content

Commit

Permalink
Update CI with current Elixir and Erlang/OTP versions (#682)
Browse files Browse the repository at this point in the history
  • Loading branch information
nathany-copia authored Jun 19, 2024
1 parent 8b7cd3d commit 3685f5f
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 46 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ jobs:
- name: Set up Elixir
uses: erlef/setup-beam@v1
with:
elixir-version: '1.13'
otp-version: '24.3'
elixir-version: '1.15'
otp-version: '25.3'
- name: Restore dependencies cache
uses: actions/cache@v4
with:
Expand Down
62 changes: 21 additions & 41 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,22 @@ jobs:
Test:
runs-on: ubuntu-latest
name: OTP ${{matrix.otp}} / Elixir ${{matrix.elixir}}
continue-on-error: ${{ matrix.experimental }}
strategy:
matrix:
elixir:
- 1.14
- 1.13
otp:
- 25.3
- 24.3
include:
- otp: '25.3.2.12'
elixir: '1.15.8'
experimental: false
lint: false
- otp: '26.2.5'
elixir: '1.16.3'
experimental: true
lint: true
- otp: '27.0'
elixir: '1.17.1'
experimental: true
lint: false
steps:
- uses: actions/checkout@v4
- name: Set up Elixir
Expand All @@ -37,25 +45,21 @@ jobs:
mix deps.get
- name: Run Tests
run: mix test --trace
- if: ${{ matrix.lint }}
name: Check Format
run: mix format --check-formatted

# This tests with Gun 1, where as the standard Test job tests Gun 2
Test-gun1:
runs-on: ubuntu-latest
name: OTP ${{matrix.otp}} / Elixir ${{matrix.elixir}} - Gun1
strategy:
matrix:
elixir:
- 1.14
- 1.13
otp:
- 25.3
- 24.3
name: Gun 1
steps:
- uses: actions/checkout@v4
- name: Set up Elixir
uses: erlef/setup-beam@v1
with:
elixir-version: ${{ matrix.elixir }}
otp-version: ${{ matrix.otp }}
elixir-version: '1.15.8'
otp-version: '25.3.2.12'
version-type: strict
- name: Restore dependencies cache
uses: actions/cache@v4
Expand All @@ -75,27 +79,3 @@ jobs:
env:
LOCKFILE: gun1
run: mix test test/tesla/adapter/gun_test.exs --trace

Linting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Elixir
uses: erlef/setup-beam@v1
with:
elixir-version: '1.13'
otp-version: '24.3'
version-type: strict
- name: Restore dependencies cache
uses: actions/cache@v4
with:
path: deps
key: ${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }}
restore-keys: ${{ runner.os }}-mix-
- name: Install Dependencies
run: |
mix local.rebar --force
mix local.hex --force
mix deps.get
- name: Check Format
run: mix format --check-formatted
2 changes: 1 addition & 1 deletion lib/tesla/adapter/hackney.ex
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ if Code.ensure_loaded?(:hackney) do
end

defp request(method, url, headers, body, opts) do
handle(:hackney.request(method, url, headers, body || '', opts), opts)
handle(:hackney.request(method, url, headers, body || ~c"", opts), opts)
end

defp request_stream(method, url, headers, body, opts) do
Expand Down
4 changes: 2 additions & 2 deletions test/tesla/middleware/timeout_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ defmodule Tesla.Middleware.TimeoutTest do
[{last_module, _, _, file_info} | _] = __STACKTRACE__

assert Tesla.Middleware.TimeoutTest.Client == last_module
assert file_info[:file] == 'lib/tesla/builder.ex'
assert file_info[:file] == ~c"lib/tesla/builder.ex"
assert file_info[:line] == 23
else
_ ->
Expand All @@ -131,7 +131,7 @@ defmodule Tesla.Middleware.TimeoutTest do
[_, {timeout_module, _, _, module_file_info} | _] = __STACKTRACE__

assert Tesla.Middleware.Timeout == timeout_module
assert module_file_info == [file: 'lib/tesla/middleware/timeout.ex', line: 59]
assert module_file_info == [file: ~c"lib/tesla/middleware/timeout.ex", line: 59]
else
_ ->
flunk("Expected exception to be thrown")
Expand Down

0 comments on commit 3685f5f

Please sign in to comment.