Skip to content

Commit

Permalink
ci: check dialyzer with option plt (#779)
Browse files Browse the repository at this point in the history
  • Loading branch information
zacky1972 authored Jan 3, 2025
1 parent 3581f0a commit 6bbe76e
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 30 deletions.
36 changes: 21 additions & 15 deletions .github/workflows/reusable_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,27 +108,33 @@ jobs:
- name: Check by credo (Ubuntu)
if: ${{ inputs.perform-check && startsWith(runner.os, 'linux') }}
run: mix credo
- name: Restore dialyzer cache (Ubuntu)
if: ${{ inputs.perform-check && startsWith(runner.os, 'linux') }}
uses: actions/cache@v4
- name: Restore PLT cache
id: plt_cache
uses: actions/cache/restore@v4
with:
key: |
plt-${{ runner.os }}-${{ steps.system-info.outputs.release }}-${{ matrix.otp-version }}-${{ matrix.elixir-version }}-${{ inputs.working-directory }}-${{ hashFiles('**/mix.lock') }}
restore-keys: |
plt-${{ runner.os }}-${{ steps.system-info.outputs.release }}-${{ matrix.otp-version }}-${{ matrix.elixir-version }}-${{ inputs.working-directory }}-
path: |
priv/plts
- name: Create PLTs
if: steps.plt_cache.outputs.cache-hit != 'true' && ${{ inputs.perform-check && startsWith(runner.os, 'linux') }}
run: mix dialyzer --plt
- name: Save PLT cache
id: plt_cache_save
uses: actions/cache/save@v4
if: steps.plt_cache.outputs.cache-hit != 'true' && ${{ inputs.perform-check && startsWith(runner.os, 'linux') }}
with:
key: |
plt-${{ runner.os }}-${{ steps.system-info.outputs.release }}-${{ matrix.otp-version }}-${{ matrix.elixir-version }}-${{ inputs.working-directory }}-${{ hashFiles('**/mix.lock') }}
path: |
${{ github.workspace }}/${{ inputs.working-directory }}/_build/dev/dialyxir_erlang-${{ matrix.otp-version }}_elixir-${{ matrix.elixir-version }}_deps-dev.plt*
${{ github.workspace }}/${{ inputs.working-directory }}/_build/test/dialyxir_erlang-${{ matrix.otp-version }}_elixir-${{ matrix.elixir-version }}_deps-test.plt*
key: ${{ runner.os }}-${{ steps.system-info.outputs.release }}-Elixir-${{ matrix.elixir-version }}-OTP-${{ matrix.otp-version }}-repo-${{ inputs.working-directory }}-plt
priv/plts
- name: Check by dialyzer (Ubuntu)
id: dialyzer
if: ${{ inputs.perform-check && startsWith(runner.os, 'linux') }}
continue-on-error: true
run: mix dialyzer
- name: Recover if fail dialyzer
if: steps.dialyzer.outcome == 'failure'
run: rm -rf |
${{ github.workspace }}/${{ inputs.working-directory }}/_build/dev/dialyxir_erlang-${{ matrix.otp-version }}_elixir-${{ matrix.elixir-version }}_deps-dev.plt*
${{ github.workspace }}/${{ inputs.working-directory }}/_build/test/dialyxir_erlang-${{ matrix.otp-version }}_elixir-${{ matrix.elixir-version }}_deps-test.plt*
- name: Check by dialyzer, again (Ubuntu)
if: ${{ inputs.perform-check && startsWith(runner.os, 'linux') && steps.dialyzer.outcome == 'failure' }}
run: mix dialyzer
run: mix dialyzer --format github
- name: Run tests
if: ${{ !inputs.perform-check }}
run: mix test
36 changes: 21 additions & 15 deletions .github/workflows/reusable_ci_with_working_directory.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,27 +105,33 @@ jobs:
- name: Check by credo (Ubuntu)
if: ${{ inputs.perform-check && startsWith(runner.os, 'linux') }}
run: mix credo
- name: Restore dialyzer cache (Ubuntu)
if: ${{ inputs.perform-check && startsWith(runner.os, 'linux') }}
uses: actions/cache@v4
- name: Restore PLT cache
id: plt_cache
uses: actions/cache/restore@v4
with:
key: |
plt-${{ runner.os }}-${{ steps.system-info.outputs.release }}-${{ matrix.otp-version }}-${{ matrix.elixir-version }}-${{ inputs.working-directory }}-${{ hashFiles('**/mix.lock') }}
restore-keys: |
plt-${{ runner.os }}-${{ steps.system-info.outputs.release }}-${{ matrix.otp-version }}-${{ matrix.elixir-version }}-${{ inputs.working-directory }}-
path: |
priv/plts
- name: Create PLTs
if: steps.plt_cache.outputs.cache-hit != 'true' && ${{ inputs.perform-check && startsWith(runner.os, 'linux') }}
run: mix dialyzer --plt
- name: Save PLT cache
id: plt_cache_save
uses: actions/cache/save@v4
if: steps.plt_cache.outputs.cache-hit != 'true' && ${{ inputs.perform-check && startsWith(runner.os, 'linux') }}
with:
key: |
plt-${{ runner.os }}-${{ steps.system-info.outputs.release }}-${{ matrix.otp-version }}-${{ matrix.elixir-version }}-${{ inputs.working-directory }}-${{ hashFiles('**/mix.lock') }}
path: |
${{ github.workspace }}/${{ matrix.working-directory }}/_build/dev/dialyxir_erlang-${{ matrix.otp-version }}_elixir-${{ matrix.elixir-version }}_deps-dev.plt*
${{ github.workspace }}/${{ matrix.working-directory }}/_build/test/dialyxir_erlang-${{ matrix.otp-version }}_elixir-${{ matrix.elixir-version }}_deps-test.plt*
key: ${{ runner.os }}-${{ steps.system-info.outputs.release }}-Elixir-${{ matrix.elixir-version }}-OTP-${{ matrix.otp-version }}-repo-${{ matrix.working-directory }}-plt
priv/plts
- name: Check by dialyzer (Ubuntu)
id: dialyzer
if: ${{ inputs.perform-check && startsWith(runner.os, 'linux') }}
continue-on-error: true
run: mix dialyzer
- name: Recover if fail dialyzer
if: steps.dialyzer.outcome == 'failure'
run: rm -rf |
${{ github.workspace }}/${{ inputs.working-directory }}/_build/dev/dialyxir_erlang-${{ matrix.otp-version }}_elixir-${{ matrix.elixir-version }}_deps-dev.plt*
${{ github.workspace }}/${{ inputs.working-directory }}/_build/test/dialyxir_erlang-${{ matrix.otp-version }}_elixir-${{ matrix.elixir-version }}_deps-test.plt*
- name: Check by dialyzer, again (Ubuntu)
if: ${{ inputs.perform-check && startsWith(runner.os, 'linux') && steps.dialyzer.outcome == 'failure' }}
run: mix dialyzer
run: mix dialyzer --format github
- name: Run tests
if: ${{ !inputs.perform-check }}
run: mix test

0 comments on commit 6bbe76e

Please sign in to comment.