-
Notifications
You must be signed in to change notification settings - Fork 38
74 lines (62 loc) · 1.81 KB
/
main.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
65
66
67
68
69
70
71
72
73
74
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:
# Latest versions
- pair:
elixir: "1.16"
otp: "26.2"
lint: lint
coverage: true
# Oldest supported versions
- pair:
elixir: "1.9.4"
otp: "20.3.8"
steps:
- name: Check out this repository
uses: actions/checkout@v3
- name: Install Erlang/OTP and Elixir
uses: erlef/setup-beam@v1
with:
otp-version: ${{ matrix.pair.otp }}
elixir-version: ${{ matrix.pair.elixir }}
version-type: strict
- name: Cache Mix dependencies
uses: actions/cache@v3
with:
path: |
deps
_build
key: |
${{ runner.os }}-mix-${{ matrix.pair.elixir }}-${{ matrix.pair.otp }}-${{ hashFiles('**/mix.lock') }}
restore-keys: |
${{ runner.os }}-mix-${{ matrix.pair.elixir }}-${{ matrix.pair.otp }}-
- name: Fetch Mix dependencies (and check mix.lock)
run: mix deps.get --check-locked
- name: Check for formatted files
run: mix format --check-formatted
if: ${{ matrix.lint }}
- name: Check for unused dependencies
run: mix deps.unlock --check-unused
if: ${{ matrix.lint }}
- name: Compile Mix dependencies
run: mix deps.compile
- name: Check for compilation warnings
run: mix compile --warnings-as-errors
if: ${{ matrix.lint }}
- run: mix test
if: ${{ !matrix.coverage }}
- run: mix coveralls.github
if: ${{ matrix.coverage }}