chore: improve middleware docs #902
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test | |
on: [pull_request] | |
jobs: | |
Test: | |
runs-on: ubuntu-latest | |
name: OTP ${{matrix.otp}} / Elixir ${{matrix.elixir}} | |
continue-on-error: ${{ matrix.experimental }} | |
strategy: | |
matrix: | |
include: | |
- elixir: '1.15.8' | |
otp: '25.3.2.12' | |
experimental: false | |
lint: false | |
- elixir: '1.16.3' | |
otp: '26.2.5' | |
experimental: false | |
lint: true | |
- elixir: '1.17.1' | |
otp: '27.0' | |
experimental: false | |
lint: false | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Elixir | |
uses: erlef/setup-beam@v1 | |
with: | |
elixir-version: ${{ matrix.elixir }} | |
otp-version: ${{ matrix.otp }} | |
version-type: strict | |
- name: Restore dependencies cache | |
uses: actions/cache@v4 | |
id: cache | |
with: | |
path: deps | |
key: ${{ runner.os }}-${{ steps.beam.outputs.elixir-version }}-${{ steps.beam.outputs.otp-version }}-mix-${{ hashFiles('**/mix.lock') }} | |
restore-keys: ${{ runner.os }}-${{ steps.beam.outputs.elixir-version }}-${{ steps.beam.outputs.otp-version }}-mix- | |
- name: Install Dependencies | |
if: steps.cache.outputs.cache-hit != 'true' | |
env: | |
MIX_ENV: test | |
run: | | |
mix local.rebar --force | |
mix local.hex --force | |
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: Gun 1 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Elixir | |
uses: erlef/setup-beam@v1 | |
with: | |
elixir-version: '1.15.8' | |
otp-version: '25.3.2.12' | |
version-type: strict | |
- name: Restore dependencies cache | |
uses: actions/cache@v4 | |
id: cache | |
with: | |
path: deps | |
key: ${{ runner.os }}-${{ steps.beam.outputs.elixir-version }}-${{ steps.beam.outputs.otp-version }}-mix-gun-${{ hashFiles('test/lockfiles/gun1.lock') }} | |
restore-keys: ${{ runner.os }}-${{ steps.beam.outputs.elixir-version }}-${{ steps.beam.outputs.otp-version }}-mix-gun- | |
- name: Install Dependencies | |
env: | |
MIX_ENV: test | |
LOCKFILE: gun1 | |
run: | | |
mix local.rebar --force | |
mix local.hex --force | |
mix deps.get | |
- name: Run Tests | |
env: | |
LOCKFILE: gun1 | |
run: mix test test/tesla/adapter/gun_test.exs --trace | |
dialyzer: | |
runs-on: ubuntu-latest | |
name: Dialyzer | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Elixir | |
uses: erlef/setup-beam@v1 | |
with: | |
elixir-version: '1.16.3' | |
otp-version: '26.2.5' | |
version-type: strict | |
- name: Restore dependencies cache | |
uses: actions/cache@v4 | |
id: cache | |
with: | |
path: | | |
deps | |
_build | |
dialyzer | |
key: ${{ runner.os }}-${{ steps.beam.outputs.elixir-version }}-${{ steps.beam.outputs.otp-version }}-dialyzer-${{ hashFiles('**/mix.lock') }} | |
restore-keys: | | |
${{ runner.os }}-${{ steps.beam.outputs.elixir-version }}-${{ steps.beam.outputs.otp-version }}-dialyzer- | |
- name: Install Dependencies | |
if: steps.cache.outputs.cache-hit != 'true' | |
env: | |
MIX_ENV: test | |
run: | | |
mix local.rebar --force | |
mix local.hex --force | |
mix deps.get | |
# Doesn't cache PLTs based on mix.lock hash, as Dialyzer can incrementally update even old ones | |
# Cache key based on Elixir & Erlang version. | |
- name: Restore PLT cache | |
uses: actions/cache@v4 | |
id: plt_cache | |
with: | |
key: | | |
${{ runner.os }}-${{ steps.beam.outputs.elixir-version }}-${{ steps.beam.outputs.otp-version }}-plt | |
restore-keys: | | |
${{ runner.os }}-${{ steps.beam.outputs.elixir-version }}-${{ steps.beam.outputs.otp-version }}-plt | |
path: | | |
priv/plts | |
# Create PLTs if no cache was found | |
- name: Create PLTs | |
if: steps.plt_cache.outputs.cache-hit != 'true' | |
run: mix dialyzer --plt | |
- name: Run dialyzer | |
run: mix dialyzer --format github |