Merge pull request #106 from highmobility/dependabot/github_actions/e… #228
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: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
permissions: | |
contents: read | |
env: | |
MIX_ENV: test | |
ELIXIR_VERSION: 1.13.4 | |
ERLANG_VERSION: 25.0 | |
jobs: | |
build: | |
name: Tests & Checks | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Elixir | |
uses: erlef/setup-beam@a6e26b22319003294c58386b6f25edbc7336819a | |
with: | |
elixir-version: ${{ env.ELIXIR_VERSION }} | |
otp-version: ${{ env.ERLANG_VERSION }} | |
- name: Restore dependencies cache | |
uses: actions/cache@v4 | |
with: | |
path: deps | |
key: ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.ERLANG_VERSION }}-mix-${{ hashFiles('**/mix.lock') }} | |
restore-keys: ${{ runner.os }}-mix- | |
- uses: actions/cache@v4 | |
name: Restore/Cache _plts | |
id: dialyzer-plts-files | |
with: | |
path: _plts/ | |
key: ${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.ERLANG_VERSION }}-dialyzer-plts-files-01-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }} | |
restore-keys: | | |
${{ runner.os }}-${{ env.ELIXIR_VERSION }}-${{ env.ERLANG_VERSION }}-dialyzer-plts-files-01-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }} | |
- name: Install dependencies | |
run: mix deps.get | |
- name: Run tests | |
run: | | |
mix compile --warnings-as-errors | |
mix test | |
- name: Run formatter | |
run: | | |
mix format --check-formatted | |
- name: Run Credo | |
run: | | |
mix credo | |
- name: Run dialyzer | |
run: | | |
mkdir -p _plts | |
mix dialyzer |