Skip to content

Commit

Permalink
ci: Fix dialyzer cache
Browse files Browse the repository at this point in the history
  • Loading branch information
Betree committed Apr 8, 2022
1 parent cf24fae commit e772008
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 11 deletions.
39 changes: 29 additions & 10 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
name: Test
on: push

on:
pull_request:
types:
- opened
- synchronize
- reopened
push:
branches:
- main
jobs:
unit-test:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -38,6 +45,7 @@ jobs:
- run: mix deps.get
- run: mix credo
dialyzer:
name: Run Dialyzer for type checking
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand All @@ -47,15 +55,26 @@ jobs:
with:
path: deps
key: ${{ runner.os }}-deps
- name: Cache PLT
id: cache-plt
uses: actions/cache@v2
with:
path: priv/plts
key: ${{ runner.os }}-plts
- uses: erlef/setup-beam@v1
id: beam
with:
otp-version: "22.2"
elixir-version: "1.9.4"
- run: mix deps.get
- run: mix dialyzer
- name: Fetch dependencies
run: mix deps.get
- name: Restore PLT cache
uses: actions/cache@v2
id: plt_cache
with:
key: |
${{ runner.os }}-${{ steps.beam.outputs.elixir-version }}-${{ steps.beam.outputs.otp-version }}-plt
restore-keys: |
${{ runner.os }}-${{ steps.beam.outputs.elixir-version }}-${{ steps.beam.outputs.otp-version }}-plt
path: |
priv/plts
# Create PLTs if no cache was found
- name: Create PLTs
if: steps.plt_cache.outputs.cache-hit != 'true'
run: mix dialyzer --plt
- name: Run dialyzer
run: mix dialyzer
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ defmodule Atomex.MixProject do

# Dev
{:credo, "~> 1.5", only: [:dev, :test], runtime: false},
{:dialyxir, "~> 1.0", only: :dev, runtime: false},
{:dialyxir, "~> 1.0", only: [:dev, :test], runtime: false},
{:earmark, "~> 1.4", only: :dev, runtime: false},
{:ex_doc, "~> 0.23", only: :dev, runtime: false},
{:excoveralls, "~> 0.13", only: :test},
Expand Down

0 comments on commit e772008

Please sign in to comment.