-
Notifications
You must be signed in to change notification settings - Fork 0
95 lines (79 loc) · 2.22 KB
/
ci.yaml
File metadata and controls
95 lines (79 loc) · 2.22 KB
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
name: Build and test
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ 'ubuntu-18.04' ]
elixir: [ '1.11.x' ]
otp: [ '23.x' ]
services:
db:
image: postgres:latest
ports: [ '5433:5432' ]
env:
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v2
- name: Set up Elixir
uses: erlef/setup-elixir@v1
with:
elixir-version: ${{ matrix.elixir }}
otp-version: ${{ matrix.otp }}
- name: Build cache
uses: actions/cache@v2
with:
path: _build
key: build-${{ matrix.os }}-${{ hashFiles('lib/**/*.ex*') }}
restore-keys: |
build-${{ matrix.os }}-
- name: Dependencies cache
uses: actions/cache@v2
with:
path: deps
key: mix-${{ matrix.os }}-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
restore-keys: mix-${{ matrix.os }}-
- name: Dialyzer PLT cache
uses: actions/cache@v2
id: plt-cache
with:
path: priv/plts
key: plt-${{ matrix.os }}-elixir${{ matrix.elixir }}-otp${{ matrix.otp }}-${{ hashFiles('lib/**/*.ex*') }}
restore-keys: |
plt-${{ matrix.os }}-elixir${{ matrix.elixir }}-otp${{ matrix.otp }}-
- name: Install dependencies
run: mix deps.get
- name: Check dependencies
run: mix deps.unlock --check-unused
- name: Check formatting
run: mix format --check-formatted
- name: Compile dependencies
run: mix deps.compile
- name: Compile dev
run: mix compile --warnings-as-errors
- name: Run Credo
run: mix credo
- name: Compile test
run: mix compile --warnings-as-errors
env:
MIX_ENV: test
- name: Run tests
run: mix test
- name: Create Dialyzer PLTs
if: steps.plt-cache.outputs.cache-hit != 'true'
run: |
mkdir -p priv/plts
mix dialyzer --plt
- name: Run Dialyzer
run: mix dialyzer --no-check