when:
  event: [push, pull_request]
  branch: main

steps:
  ci:
    image: elixir:1.18.3-otp-27
    commands:
      - mix deps.get
      - mix compile --warnings-as-errors
      - mix format --check-formatted
      - mix credo
      - mix test
    environment:
      MIX_ENV: ci

services:
  postgres:
    image: postgres:15-alpine
    environment:
      POSTGRES_PASSWORD: postgres
