GitHub actions #4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
pull_request: | |
branches: | |
- main | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
env: | |
MIX_ENV: test | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- elixir: '1.15.8' | |
otp: '25.3.2.15' | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: erlef/setup-beam@v1 | |
with: | |
otp-version: ${{matrix.otp}} | |
elixir-version: ${{matrix.elixir}} | |
- name: Cache build artifacts | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.hex | |
~/.mix | |
_build | |
priv/plts | |
key: otp:${{ matrix.otp }}-elixir:${{ matrix.elixir }}-mix-lock:${{ hashFiles('**/mix.lock') }} | |
- name: Install Dependencies | |
run: | | |
mix local.rebar --force | |
mix local.hex --force | |
mix deps.get | |
- name: Compile Deps | |
run: mix deps.compile | |
- name: Compile | |
run: mix compile --warnings-as-errors | |
- name: Format check | |
run: mix format --check-formatted | |
- name: Run Tests | |
run: mix test | |
- name: Run credo | |
run: mix credo suggest |