Skip to content

Github Actions (#112) #1

Github Actions (#112)

Github Actions (#112) #1

Workflow file for this run

name: Elixir CI
on: push
env:
MIX_ENV: test
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
elixir: ["1.13", "1.14", "1.15"]
otp: ["25", "26"]
exclude:
- elixir: 1.13
otp: 26
- elixir: 1.14
otp: 26
steps:
- uses: actions/checkout@v3
- name: Setup elixir
uses: erlef/setup-beam@v1
with:
elixir-version: ${{ matrix.elixir }}
otp-version: ${{ matrix.otp }}
- name: Restore dependencies cache
uses: actions/cache@v3
id: mix-cache
with:
path: deps
key: ${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }}
restore-keys: ${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }}
- name: Install dependencies
if: steps.mix-cache.outputs.cache-hit != 'true'
run: |
mix local.rebar --force
mix local.hex --force
mix deps.get
- name: Compile & error on warning
run: mix compile --warnings-as-errors
- name: Check formatting
run: mix format --check-formatted
- name: Run credo
run: mix credo --strict
- name: Retrieve PLT cache
uses: actions/cache@v3
id: plt-cache
with:
path: priv/plts
key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-plts-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
restore-keys: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-plts-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
- name: Create PLTs
if: steps.plt-cache.outputs.cache-hit != 'true'
run: |
mkdir -p priv/plts
mix dialyzer --plt
- name: Run dialyzer
run: mix dialyzer --no-check --halt-exit-status
- name: Run tests
run: mix coveralls.github