Skip to content

Add an explicit step to a range #46

Add an explicit step to a range

Add an explicit step to a range #46

Workflow file for this run

name: CI
on:
pull_request:
push:
branches:
- main
jobs:
test:
name: Test (Elixir ${{ matrix.elixir }}, OTP ${{ matrix.erlang }})
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
include:
- erlang: "25.3"
elixir: "1.14.2"
lint: true
coverage: true
- erlang: "20.3"
elixir: "1.7.4"
env:
MIX_ENV: test
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v3
- name: Install Erlang and Elixir
uses: erlef/setup-beam@v1
with:
otp-version: ${{ matrix.erlang }}
elixir-version: ${{ matrix.elixir }}
- name: Install dependencies
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@v3
id: cache-plt
with:
path: priv/plts
key: ${{ runner.os }}-otp${{ matrix.erlang }}-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 do deps.get, deps.unlock --check-unused
if: ${{ matrix.lint }}
- name: Compile with --warnings-as-errors
run: mix compile --warnings-as-errors
if: ${{ matrix.lint }}
- name: Run tests
run: mix test --trace
if: ${{ !matrix.coverage }}
- name: Run tests with coverage
run: mix coveralls.github --trace
if: ${{ matrix.coverage }}
- name: Run Dialyzer
run: mix dialyzer