Skip to content

Merge pull request #32 from dgigafox/release/v1.2.3 #97

Merge pull request #32 from dgigafox/release/v1.2.3

Merge pull request #32 from dgigafox/release/v1.2.3 #97

Workflow file for this run

name: Elixir CI
on: push
env:
MIX_ENV: test
jobs:
build:
runs-on: ubuntu-latest
services:
postgres:
image: postgres
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: test_drill
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
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@v4
- name: Setup elixir
uses: erlef/setup-beam@v1
with:
elixir-version: ${{ matrix.elixir }}
otp-version: ${{ matrix.otp }}
- name: Restore dependencies cache
uses: actions/cache@v4
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@v4
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
- run: mix ecto.reset
- name: Run tests
run: mix test