Skip to content

Merge pull request #208 from kianmeng/ci-housekeeping #51

Merge pull request #208 from kianmeng/ci-housekeeping

Merge pull request #208 from kianmeng/ci-housekeeping #51

Workflow file for this run

name: CI
on:
pull_request:
push:
branches:
- main
jobs:
test:
name: Elixir ${{matrix.pair.elixir}} / OTP ${{matrix.pair.otp}}
runs-on: ubuntu-20.04
strategy:
matrix:
include:
- pair:
elixir: "1.12"
otp: "22"
- pair:
elixir: "1.17"
otp: "27"
lint: true
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Elixir
uses: erlef/setup-beam@v1
with:
elixir-version: ${{ matrix.pair.elixir }}
otp-version: ${{ matrix.pair.otp }}
- name: Restore deps cache
uses: actions/cache@v3
with:
path: |
deps
_build
key: deps-${{ runner.os }}-${{ matrix.pair.otp }}-${{ matrix.pair.elixir }}-${{ hashFiles('**/mix.lock') }}-git-${{ github.sha }}
restore-keys: |
deps-${{ runner.os }}-${{ matrix.pair.otp }}-${{ matrix.pair.elixir }}-${{ hashFiles('**/mix.lock') }}
deps-${{ runner.os }}-${{ matrix.pair.otp }}-${{ matrix.pair.elixir }}
- name: Install package dependencies
run: mix deps.get
- name: Check unused deps
run: mix deps.unlock --check-unused
if: ${{ matrix.lint }}
- name: Check code format
run: mix format --check-formatted
if: ${{ matrix.lint }}
- name: Compile dependencies
run: mix compile
env:
MIX_ENV: test
- name: Run unit tests
run: mix test