add dialyzer and split formatter to one version only (#66) #167
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: | |
- master | |
push: | |
branches: | |
- master | |
jobs: | |
setup: | |
runs-on: ${{ matrix.os }} | |
env: | |
MIX_ENV: test | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-22.04] | |
elixir_version: [1.15, 1.16, 1.17] | |
otp_version: [ 25, 26, 27] | |
exclude: | |
- otp_version: 27 | |
elixir_version: 1.15 | |
- otp_version: 27 | |
elixir_version: 1.16 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Elixir | |
id: beam | |
uses: erlef/setup-beam@v1 | |
with: | |
otp-version: ${{matrix.otp_version}} | |
elixir-version: ${{matrix.elixir_version}} | |
- uses: actions/cache@v4 | |
with: | |
path: | | |
deps | |
_build | |
key: deps-${{ runner.os }}-${{ matrix.otp_version }}-${{ matrix.elixir_version }}-${{ hashFiles('**/mix.lock') }} | |
restore-keys: | | |
deps-${{ runner.os }}-${{ matrix.otp_version }}-${{ matrix.elixir_version }} | |
- run: mix deps.get | |
- run: mix deps.unlock --check-unused | |
- run: mix deps.compile | |
- run: mix compile --warnings-as-errors | |
- run: mix credo --strict --format=oneline | |
- run: mix test --warnings-as-errors --cover | |
dialyzer: | |
runs-on: ubuntu-22.04 | |
env: | |
MIX_ENV: dev | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Elixir | |
id: beam | |
uses: erlef/setup-beam@v1 | |
with: | |
elixir-version: 1.16 | |
otp-version: 26 | |
- uses: actions/cache@v4 | |
with: | |
path: | | |
deps | |
_build | |
key: deps-${{ runner.os }}-${{ steps.beam.outputs.otp-version }}-${{ steps.beam.outputs.elixir-version }}-${{ hashFiles('**/mix.lock') }} | |
restore-keys: | | |
deps-${{ runner.os }}-${{ steps.beam.outputs.otp-version }}-${{ steps.beam.outputs.elixir-version }} | |
- run: mix deps.get | |
- name: Restore PLT cache | |
id: plt_cache_restore | |
uses: actions/cache/restore@v3 | |
with: | |
key: | | |
plts-${{ runner.os }}-${{ steps.beam.outputs.otp-version }}-${{ steps.beam.outputs.elixir-version }}-${{ hashFiles('**/mix.lock') }} | |
restore-keys: | | |
plts-${{ runner.os }}-${{ steps.beam.outputs.otp-version }}-${{ steps.beam.outputs.elixir-version }}- | |
path: | | |
priv/plts | |
- name: Create PLTs | |
if: steps.plt_cache_restore.outputs.cache-hit != 'true' | |
run: mix dialyzer --plt | |
- name: Save PLT cache | |
id: plt_cache_save | |
if: steps.plt_cache_restore.outputs.cache-hit != 'true' | |
uses: actions/cache/save@v3 | |
with: | |
key: | | |
plts-${{ runner.os }}-${{ steps.beam.outputs.otp-version }}-${{ steps.beam.outputs.elixir-version }}-${{ hashFiles('**/mix.lock') }} | |
path: | | |
priv/plts | |
- name: Run dialyzer | |
run: mix dialyzer --format github --format dialyxir | |
check_format: | |
runs-on: ubuntu-22.04 | |
env: | |
MIX_ENV: dev | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Elixir | |
id: beam | |
uses: erlef/setup-beam@v1 | |
with: | |
elixir-version: 1.16 | |
otp-version: 26 | |
- uses: actions/cache@v4 | |
with: | |
path: | | |
deps | |
_build | |
key: deps-${{ runner.os }}-${{ steps.beam.outputs.otp-version }}-${{ steps.beam.outputs.elixir-version }}-${{ hashFiles('**/mix.lock') }} | |
restore-keys: | | |
deps-${{ runner.os }}-${{ steps.beam.outputs.otp-version }}-${{ steps.beam.outputs.elixir-version }} | |
- run: mix deps.get | |
- run: mix format --check-formatted |