Skip to content

Fix CI and update Elixir and OTP versions #173

Fix CI and update Elixir and OTP versions

Fix CI and update Elixir and OTP versions #173

Workflow file for this run

name: CI
on:
pull_request:
push:
branches:
- main
jobs:
test:
runs-on: ubuntu-20.04
env:
MIX_ENV: test
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
strategy:
fail-fast: false
matrix:
include:
# Hard to test the oldest-supported version because rabbit_common and friends
# are a bit hard to get compatibility right for. However, we don't really need
# to do that here.
- elixir: "1.16"
otp: "26.2"
# Latest-supported Elixir/OTP versions.
- elixir: "1.17.3"
otp: "27.1"
lint: lint
coverage: coverage
steps:
- name: Clone the repository
uses: actions/checkout@v4
- name: Start Docker
run: docker compose up --detach
- name: Install Erlang/OTP and Elixir
uses: erlef/setup-beam@v1
with:
otp-version: ${{ matrix.otp }}
elixir-version: ${{ matrix.elixir }}
- name: Cache Mix dependencies
uses: actions/cache@v4
with:
path: |
deps
_build
key: |
${{ runner.os }}-mix-${{ matrix.elixir }}-${{ matrix.otp }}-${{ hashFiles('**/mix.lock') }}
restore-keys: |
${{ runner.os }}-mix-${{ matrix.elixir }}-${{ matrix.otp }}-
- name: Fetch Mix dependencies
run: mix deps.get
- name: Run the formatter
run: mix format --check-formatted
if: ${{ matrix.lint }}
- name: Check for unused dependencies
run: mix deps.unlock --check-unused
if: ${{ matrix.lint }}
- name: Compile code and check for warnings
run: mix compile --warnings-as-errors
if: ${{ matrix.lint }}
- name: Run tests
run: mix test
if: ${{ !matrix.coverage }}
- name: Run tests with coverage
run: mix coveralls.github
if: ${{ matrix.coverage }}