fix types, appease dialyzer #897
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
jobs: | |
mix_test: | |
runs-on: ubuntu-20.04 | |
env: | |
MIX_ENV: test | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- pair: | |
elixir: "1.11.4" | |
otp: "22.x" | |
- pair: | |
elixir: "1.16.0" | |
otp: "26.x" | |
lint: lint | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/cache@v3 | |
with: | |
path: deps | |
key: deps-${{ runner.os }}-${{ matrix.pair.otp }}-${{ matrix.pair.elixir }}-${{ hashFiles('**/mix.lock') }} | |
restore-keys: deps-${{ runner.os }}-${{ matrix.pair.otp }}-${{ matrix.pair.elixir }}- | |
- uses: actions/cache@v3 | |
with: | |
path: _build | |
key: build-${{ runner.os }}-${{ matrix.pair.otp }}-${{ matrix.pair.elixir }}-${{ hashFiles('**/mix.lock') }} | |
restore-keys: build-${{ runner.os }}-${{ matrix.pair.otp }}-${{ matrix.pair.elixir }}- | |
- uses: erlef/setup-beam@v1 | |
with: | |
otp-version: ${{matrix.pair.otp}} | |
elixir-version: ${{matrix.pair.elixir}} | |
# 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@v3 | |
id: cache-plt | |
with: | |
path: plts | |
key: | | |
${{ runner.os }}-plt-otp${{ matrix.erlang }}-elixir${{ matrix.elixir }}-${{ hashFiles('**/mix.lock') }} | |
restore-keys: | | |
${{ runner.os }}-plt-otp${{ matrix.erlang }}-elixir${{ matrix.elixir }}- | |
# Create PLTs if no cache was found | |
- name: Create PLTs | |
if: ${{ matrix.dialyzer && steps.cache-plt.outputs.cache-hit != 'true' }} | |
run: mix dialyzer --plt | |
- name: Install Dependencies | |
run: mix deps.get | |
- run: mix format --check-formatted | |
if: ${{ matrix.lint }} | |
- run: mix deps.unlock --check-unused | |
if: ${{ matrix.lint }} | |
- run: mix deps.compile | |
- run: mix compile --warnings-as-errors | |
if: ${{ matrix.lint }} | |
- name: Run Credo | |
run: mix credo | |
if: ${{ matrix.lint }} | |
- name: Run Tests | |
run: mix test | |
if: ${{ ! matrix.lint }} | |
- name: Run Tests | |
run: mix test --warnings-as-errors | |
if: ${{ matrix.lint }} | |
- name: Run Dialyzer | |
run: mix dialyzer | |
if: ${{ matrix.lint }} |