Skip to content

build: add CI

build: add CI #3

name: Build and Test
on:
push:
branches:
- main
pull_request:
jobs:
static_analysis:
name: Static Analysis
runs-on: ubuntu-latest
env:
MIX_ENV: test
strategy:
matrix:
elixir: ["1.15.7"]
otp: ["26"]
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Setup Elixir
uses: erlef/setup-elixir@v1
with:
otp-version: ${{ matrix.otp }}
elixir-version: ${{ matrix.elixir }}
- name: Restore cache
uses: actions/cache@v3
with:
path: |
deps
_build
priv/plts
key: ${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }}
restore-keys: |
${{ runner.os }}-mix-
- name: Install dependencies
run: mix deps.get
- name: Mix formatter
run: mix format --check-formatted
- name: Check for compiler warnings
run: mix compile --warnings-as-errors
- name: Credo strict checks
run: mix credo --strict
- name: Dialyzer checks
run: mix dialyzer
tests:
name: Run tests
runs-on: ubuntu-latest
strategy:
matrix:
elixir: ["1.15.7"]
otp: ["26"]
steps:
- name: Checkout repository
uses: actions/checkout/@v2
- name: Setup Elixir
uses: erlef/setup-elixir@v1
with:
otp-version: ${{ matrix.otp }}
elixir-version: ${{ matrix.elixir }}
- name: Install dependencies
run: mix deps.get
- name: Run tests
env:
MIX_ENV: test
run: mix coveralls