Skip to content

Merge pull request #124 from mischov/chore/fix-ci-badge #14

Merge pull request #124 from mischov/chore/fix-ci-badge

Merge pull request #124 from mischov/chore/fix-ci-badge #14

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
branches: ["**"]
jobs:
check-formatting:
name: Check formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Elixir
uses: erlef/setup-beam@v1
with:
otp-version: 25.0
elixir-version: 1.14
- name: Check Elixir formatting
run: mix format --check-formatted
test-elixir:
name: Test Elixir ${{ matrix.elixir }} / OTP ${{ matrix.otp }}
env:
MIX_ENV: test
strategy:
fail-fast: false
matrix:
include:
- elixir: 1.12
otp: 23
- elixir: 1.13
otp: 24
- elixir: 1.14
otp: 25
# TODO change this to ubuntu-latest after OTP 23 is deprecated, see
# https://github.com/erlef/setup-beam#compatibility-between-operating-system-and-erlangotp
# for compatibility
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Set up Elixir
uses: erlef/setup-beam@v1
with:
otp-version: ${{ matrix.otp }}
elixir-version: ${{ matrix.elixir }}
- name: Retrieve cached Elixir dependencies
uses: actions/cache@v3
id: mix-cache
with:
path: deps
key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
restore-keys: |
${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-
- name: Retrieve cached Elixir build
uses: actions/cache@v3
id: build-cache
with:
path: _build
key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-build-${{ github.sha }}
restore-keys: |
${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-build-
- name: Install Elixir dependencies
if: steps.mix-cache.outputs.cache-hit != 'true'
run: |
mix local.rebar --force
mix local.hex --force
mix deps.get
mix deps.compile
- name: Compile Elixir
run: mix compile
- name: Run tests
run: mix test