-
-
Notifications
You must be signed in to change notification settings - Fork 1
55 lines (53 loc) · 1.62 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
name: CI
on:
push:
branches:
- main
pull_request:
jobs:
ci:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# Source: https://hexdocs.pm/elixir/compatibility-and-deprecations.html#between-elixir-and-erlang-otp
elixir-version: [1.14, 1.15, 1.16, 1.17]
otp-version: [24, 25, 26]
lint: [lint]
include:
- elixir-version: 1.17
otp-version: 27
lint: lint
exclude:
- elixir-version: 1.14
otp-version: 26
- elixir-version: 1.17
otp-version: 24
steps:
- uses: actions/checkout@v4
- name: Set up Elixir
uses: erlef/setup-beam@v1
with:
elixir-version: ${{matrix.elixir-version}}
otp-version: ${{matrix.otp-version}}
- name: Restore elixir dependencies cache
uses: actions/cache@v4
with:
path: deps
key: ${{runner.os}}-mix-${{matrix.elixir-version}}-${{matrix.otp-version}}-${{hashFiles('**/mix.lock')}}
restore-keys: ${{runner.os}}-mix-${{matrix.elixir-version}}-${{matrix.otp-version}}-
- name: Install dependencies
run: mix deps.get --only test
- name: Check syntax formatting
run: mix format --check-formatted
if: ${{matrix.lint}}
- name: Check for unused dependencies
run: mix deps.unlock --check-unused
if: ${{matrix.lint}}
- name: Compile dependencies
run: mix deps.compile
- name: Compile
run: mix compile --warnings-as-errors
if: ${{matrix.lint}}
- name: Run tests
run: mix test