Skip to content

Use ranges with step in tests #183

Use ranges with step in tests

Use ranges with step in tests #183

Workflow file for this run

name: CI
on:
pull_request:
push:
branches:
- main
jobs:
test:
name: Test (Elixir ${{ matrix.elixir }} | Erlang/OTP ${{ matrix.otp }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- otp: "27.0"
elixir: "1.17"
os: ubuntu-22.04
lint: true
coverage: true
- otp: "23.3"
elixir: "1.12"
os: ubuntu-20.04
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MIX_ENV: test
steps:
- name: Clone repository
uses: actions/checkout@v3
- name: Install OTP and Elixir
uses: erlef/setup-beam@v1
with:
otp-version: ${{ matrix.otp }}
elixir-version: ${{ matrix.elixir }}
version-type: strict
- name: Install dependencies
run: mix do deps.get --only test, deps.compile
- name: Check for formatted code
if: ${{ matrix.lint }}
run: mix format --check-formatted
- name: Cache/uncache PLTs
uses: actions/cache@v3
with:
path: |
priv/plts
key: "${{ runner.os }}-\
erlang-${{ matrix.otp }}-\
elixir-${{ matrix.elixir }}-\
${{ hashFiles('mix.lock') }}"
- name: Run Dialyzer
run: mix dialyzer
- name: Check for unused dependencies
if: ${{ matrix.lint }}
run: mix do deps.get, deps.unlock --check-unused
- name: Check for compilation warnings
if: ${{ matrix.lint }}
run: mix compile --warnings-as-errors
- name: Run tests
run: mix test --trace
if: ${{ !matrix.coverage }}
- name: Run tests with coverage
run: mix coveralls.github
if: ${{ matrix.coverage }}