Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix dialyzer CI caching #62

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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