diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 44a352e..0097801 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -35,19 +35,30 @@ jobs: elixir-version: ${{matrix.elixir}} - name: Install dependencies - run: mix deps.get --only test + run: mix deps.get --only test, deps.compile + + # Don't cache PLTs based on mix.lock hash, as Dialyzer can incrementally update even old ones + # Cache key based on Elixir & Erlang version (also useful when running in matrix) + - name: Cache Dialyzer's PLT + uses: actions/cache@v2 + id: cache-plt + with: + path: priv/plts + key: ${{ runner.os }}-otp${{ matrix.otp }}-elixir${{ matrix.elixir }} + + # Create PLTs if no cache was found + - name: Create PLTs + if: steps.cache-plt.outputs.cache-hit != 'true' + run: mix do deps.get, dialyzer --plt - name: Check formatting run: mix format --check-formatted if: ${{matrix.lint}} - name: Check for unused dependencies - run: mix deps.get && mix deps.unlock --check-unused + run: mix do deps.get, deps.unlock --check-unused if: ${{matrix.lint}} - - name: Compile dependencies - run: mix deps.compile - - name: Compile with --warnings-as-errors run: mix compile --warnings-as-errors if: ${{matrix.lint}} @@ -59,3 +70,6 @@ jobs: - name: Run tests with coverage run: mix coveralls.github --trace if: ${{matrix.coverage}} + + - name: Run Dialyzer + run: mix dialyzer