-
Notifications
You must be signed in to change notification settings - Fork 3
64 lines (55 loc) · 1.44 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name: CI
on:
pull_request:
push:
branches:
- main
jobs:
test:
name: Test
env:
MIX_ENV: test
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-20.04
pair:
elixir: '1.11.x'
otp: '21.x'
- os: ubuntu-22.04
pair:
elixir: '1.14.x'
otp: '25.x'
lint: lint
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Erlang and Elixir
uses: erlef/setup-beam@v1
with:
otp-version: ${{matrix.pair.otp}}
elixir-version: ${{matrix.pair.elixir}}
- name: Fetch Hex Cache
uses: actions/cache@v3
id: hex-cache
with:
path: |
deps
_build
key: ${{ runner.os }}-mix-${{matrix.pair.otp}}-${{matrix.pair.elixir}}-${{ hashFiles('mix.lock') }}
restore-keys: |
${{ runner.os }}-mix-${{matrix.pair.otp}}-${{matrix.pair.elixir}}-
- name: Install Dependencies
run: mix deps.get --only test
- name: Check Formatting
run: mix format --check-formatted
if: ${{ matrix.lint }}
- name: Check Dependencies
run: mix deps.get && mix deps.unlock --check-unused
if: ${{ matrix.lint }}
- name: Test
run: |
mix compile --warnings-as-errors
mix test