-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (50 loc) · 1.34 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
name: Elixir CI
on:
pull_request:
types:
- opened
- synchronize
- reopened
push:
branches:
- main
jobs:
mix_test:
name: mix test (Elixir ${{matrix.elixir}} | OTP ${{matrix.otp}})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- elixir: 1.13.x
otp: 24.2.x
warnings_as_errors: true
static_analysis: true
env:
MIX_ENV: test
steps:
- uses: actions/checkout@v2
- uses: erlef/setup-elixir@v1
with:
elixir-version: ${{ matrix.elixir }}
otp-version: ${{ matrix.otp }}
- name: Install Dependencies
run: |
mix local.hex --force
mix local.rebar --force
mix deps.get --only test
- name: Cache build artifacts
uses: actions/cache@v2
with:
path: |
~/.hex
~/.mix
_build
key: os-${{ runner.os }}-otp-${{ matrix.otp }}-elixir-${{ matrix.elixir }}-build-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
- run: mix format --check-formatted
- run: mix compile --warnings-as-errors
if: matrix.warnings_as_errors
- run: mix credo --strict
- run: mix test
- run: mix dialyzer --halt-exit-status
if: matrix.static_analysis