Skip to content

feat: support middleware #450

feat: support middleware

feat: support middleware #450

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
env:
MIX_ENV: test
permissions:
pull-requests: read
statuses: write
jobs:
test:
name: Test (Elixir ${{ matrix.elixir }} / OTP ${{ matrix.otp }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# NOTE: best effort coverage
# https://hexdocs.pm/elixir/compatibility-and-deprecations.html#compatibility-between-elixir-and-erlang-otp
elixir: ["1.15", "1.16"]
otp: ["24.3", "25.3"]
steps:
- uses: actions/checkout@v3
- name: Setup Elixir
uses: erlef/setup-beam@v1
with:
otp-version: ${{ matrix.otp }}
elixir-version: ${{ matrix.elixir }}
- name: Set Node.js 20.x
uses: actions/setup-node@v3
with:
node-version: 20.x
- name: Install inngest-cli
run: |
npm i -g inngest-cli
inngest-cli version
- name: Dependency cache
uses: actions/cache@v3
with:
path: |
deps
# _build
key: mix-test-${{ runner.os }}-${{ hashFiles('**/mix.lock') }}
restore-keys: |
mix-test-${{ runner.os }}-${{ matrix.elixir }}-${{ matrix.otp }}-${{ hashFiles('**/mix.lock') }}
mix-test-${{ runner.os }}-${{ matrix.elixir }}-${{ matrix.otp }}-
mix-test-
- name: Install dependencies
run: make deps
- name: Build
run: make build
- name: Run tests with coverage
run: mix coveralls.json
env:
MIX_ENV: test
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
formatter:
name: Formatter
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Elixir
uses: erlef/setup-beam@v1
with:
otp-version: 25.3
elixir-version: 1.14.4
- name: Dependency cache
uses: actions/cache@v3
with:
path: |
deps
_build
key: mix-fmt-${{ runner.os }}-${{ hashFiles('**/mix.lock') }}
restore-keys: |
mix-fmt-${{ runner.os }}-${{ hashFiles('**/mix.lock') }}
mix-fmt-${{ runner.os }}-
mix-fmt-
- name: Install dependencies
run: make deps
- name: Run Formatter
run: make fmt
linter:
name: Linter
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Elixir
uses: erlef/setup-beam@v1
with:
otp-version: 25.3
elixir-version: 1.14.4
- name: Dependency cache
uses: actions/cache@v3
with:
path: |
deps
_build
key: mix-lint-${{ runner.os }}-${{ hashFiles('**/mix.lock') }}
restore-keys: |
mix-lint-${{ runner.os }}-${{ hashFiles('**/mix.lock') }}
mix-lint-${{ runner.os }}-
mix-lint-
- name: Install dependencies
run: make deps
- name: Run Linter
run: make lint
dialyzer:
name: Dialyzer
runs-on: ubuntu-latest
env:
MIX_ENV: dev
steps:
- uses: actions/checkout@v3
- name: Setup Elixir
uses: erlef/setup-beam@v1
with:
otp-version: 25.3
elixir-version: 1.14.4
- name: Dependency cache
uses: actions/cache@v3
with:
path: |
deps
_build
key: mix-dialyzer-${{ runner.os }}-${{ hashFiles('**/mix.lock') }}
restore-keys: |
mix-dialyzer-${{ runner.os }}-${{ hashFiles('**/mix.lock') }}
mix-dialyzer-${{ runner.os }}-
mix-dialyzer-
- name: Install dependencies
run: make deps
- name: Run Dialyzer
run: make dialyzer