-
Notifications
You must be signed in to change notification settings - Fork 0
103 lines (84 loc) · 2.73 KB
/
elixir.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
name: CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
env:
MIX_ENV: test
jobs:
build:
name: OTP ${{matrix.otp}} / Elixir ${{matrix.elixir}}
runs-on: ubuntu-latest
strategy:
matrix:
otp: ['21.3', '22.3', '23.2']
elixir: ['1.10.4', '1.11.3']
services:
db:
image: postgres:12
ports: ['5432:5432']
env:
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Cancel previous runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- name: Check out repository
uses: actions/checkout@v2
- name: Set up Elixir
uses: actions/setup-elixir@v1
with:
otp-version: ${{matrix.otp}}
elixir-version: ${{matrix.elixir}}
- name: Cache global mix
uses: actions/cache@v2
with:
path: ~/.mix
key: cache-${{ runner.os }}-mix-${{ matrix.otp }}-${{ matrix.elixir }}
- name: Cache dependencies
uses: actions/cache@v2
id: cache-deps-get
with:
path: deps
key: cache-${{ runner.os }}-deps-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
- name: Install dependencies
if: steps.cache-deps-get.outputs.cache-hit != 'true'
run: |
mix local.rebar --force
mix local.hex --force
mix deps.get --only test
- name: Cache build
uses: actions/cache@v2
id: cache-deps-compilation
with:
path: _build
key: cache-${{ runner.os }}-build-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
- name: Compile dependencies
if: steps.cache-deps-compilation.outputs.cache-hit != 'true'
run: mix compile
- name: Cache PLTs
uses: actions/cache@v2
id: cache-plts
with:
path: priv/plts
key: cache-${{ runner.os }}-plts-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
- name: Create PLTs
if: steps.cache-plts.outputs.cache-hit != 'true'
run: |
mkdir -p priv/plts
mix dialyzer --plt
- name: Compiler warnings, code formatting, Credo, Dialyzer, Doctor
run: mix check --except ex_unit --except inch_ex
- name: Run tests
run: mix coveralls.github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Run Inch
run: mix inch.report