Skip to content

Commit

Permalink
Run dialyzer in CI
Browse files Browse the repository at this point in the history
This runs as its own job because it requires the 'dev' build
environment.
  • Loading branch information
jparise committed Mar 4, 2021
1 parent 894f7d9 commit 547541c
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 3 deletions.
44 changes: 43 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,50 @@ jobs:
run: mix deps.get
- name: Check format
run: mix format --check-formatted
dialyzer:
name: Dialyzer
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
otp: [22.2]
elixir: [1.11]
env:
MIX_ENV: dev
steps:
- uses: actions/checkout@v1
- uses: actions/setup-elixir@v1
with:
otp-version: ${{ matrix.otp }}
elixir-version: ${{ matrix.elixir }}
- name: Set up dependency cache
uses: actions/cache@v1
with:
path: deps/
key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-deps-${{ hashFiles('**/mix.lock') }}
restore-keys: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-deps-
- name: Set up build cache
uses: actions/cache@v1
with:
path: _build/test/
key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-build-${{ hashFiles('**/mix.lock') }}
restore-keys: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-build-
- name: Set up PLT cache
uses: actions/cache@v1
with:
path: priv/plts/
key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-plt-${{ hashFiles('**/mix.lock') }}
restore-keys: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-plt-
- name: Install dependencies
run: mix deps.get --only dev
- name: Compile
run: |
mix deps.compile
mix compile
- name: Run dialyzer
run: mix dialyzer
test:
name: OTP ${{ matrix.otp }} / Elixir ${{ matrix.elixir }}
name: Test OTP ${{ matrix.otp }} / Elixir ${{ matrix.elixir }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
/deps
/doc
/log
/priv/plts
erl_crash.dump
*.ez
data.*
Expand Down
4 changes: 2 additions & 2 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ defmodule Elixometer.Mixfile do
elixirc_paths: elixirc_paths(Mix.env()),

# Dialyzer
dialyzer: [plt_add_deps: :transitive],
dialyzer: [plt_add_deps: :transitive, plt_file: {:no_warn, "priv/plts/dialyzer.plt"}],

# Docs
name: "Elixometer",
Expand Down Expand Up @@ -62,7 +62,7 @@ defmodule Elixometer.Mixfile do
# https://github.com/basho/lager/pull/321
{:lager, ">= 3.2.1"},
{:exometer_core, "~> 1.5"},
{:dialyxir, "~> 1.0", only: :dev, runtime: false},
{:dialyxir, "~> 1.1.0", only: :dev, runtime: false},
{:ex_doc, "~> 0.20", only: :dev},
{:excoveralls, "~> 0.12", only: [:dev, :test]},
{:pobox, "~> 1.2"}
Expand Down

0 comments on commit 547541c

Please sign in to comment.