Skip to content

Require Elixir 1.12+ #51

Require Elixir 1.12+

Require Elixir 1.12+ #51

Workflow file for this run

name: CI
on:
pull_request:
push:
branches:
- main
jobs:
test:
name: Test (Elixir ${{ matrix.elixir }}, OTP ${{ matrix.erlang }})
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
include:
- erlang: "27.0"
elixir: "1.17"
lint: true
coverage: true
- erlang: "23.3"
elixir: "1.12"
env:
MIX_ENV: test
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
- name: Install Erlang and Elixir
uses: erlef/setup-beam@v1
with:
otp-version: ${{ matrix.erlang }}
elixir-version: ${{ matrix.elixir }}
- name: Install dependencies
run: mix deps.get --only test
# Don't cache PLTs based on mix.lock hash, as Dialyzer can incrementally update even old ones
# Cache key based on Elixir & Erlang version (also useful when running in matrix)
- name: Cache Dialyzer's PLT
uses: actions/cache@v4
id: cache-plt
with:
path: priv/plts
key: ${{ runner.os }}-otp${{ matrix.erlang }}-elixir${{ matrix.elixir }}
# Create PLTs if no cache was found
- name: Create PLTs
if: steps.cache-plt.outputs.cache-hit != 'true'
run: mix do deps.get, dialyzer --plt
- name: Check formatting
run: mix format --check-formatted
if: ${{ matrix.lint }}
- name: Check for unused dependencies
run: mix do deps.get, deps.unlock --check-unused
if: ${{ matrix.lint }}
- name: Compile with --warnings-as-errors
run: mix compile --warnings-as-errors
if: ${{ matrix.lint }}
- name: Run tests
run: mix test --trace
if: ${{ !matrix.coverage }}
- name: Run tests with coverage
run: mix coveralls.github --trace
if: ${{ matrix.coverage }}
- name: Run Dialyzer
run: mix dialyzer