-
Notifications
You must be signed in to change notification settings - Fork 94
132 lines (127 loc) · 4.12 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
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
name: Build
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
permissions:
contents: read
jobs:
analyze:
runs-on: ubuntu-20.04
name: Run Dialyzer on ${{matrix.environment.elixir-version}} / OTP ${{matrix.environment.otp-version}}
strategy:
matrix:
environment:
- elixir-version: 1.15
otp-version: 25.0.4
- elixir-version: 1.14
otp-version: 25.0.4
- elixir-version: 1.13
otp-version: 24.3.4
- elixir-version: 1.12
otp-version: 23.3.4
- elixir-version: 1.11
otp-version: 23.3.4
- elixir-version: '1.10'
otp-version: 22.3.4
- elixir-version: 1.9
otp-version: 22.3.4
- elixir-version: 1.8
otp-version: 21.3.8
steps:
- uses: actions/checkout@v3
- name: Set up Elixir
uses: erlef/setup-beam@988e02bfe678367a02564f65ca2e37726dc0268f
with: ${{matrix.environment}}
- name: Restore dependencies cache
uses: actions/cache@v3
with:
path: deps/
key: deps-${{ runner.os }}-${{ matrix.environment.otp-version }}-${{ matrix.environment.elixir-version }}-${{ hashFiles('**/mix.lock') }}
- name: Restore build cache
uses: actions/cache@v3
with:
path: _build/test/
key: build-${{ runner.os }}-${{ matrix.environment.otp-version }}-${{ matrix.environment.elixir-version }}-${{ hashFiles('**/mix.lock') }}
- name: Install dependencies
run: |
mix local.rebar --force
mix local.hex --force
mix deps.get
mix compile
- name: Restore PLT cache
uses: actions/cache@v2
id: plt_cache
with:
key: |
${{ runner.os }}-${{ matrix.environment.elixir-version }}-${{ matrix.environment.otp-version }}-plt
restore-keys: |
${{ runner.os }}-${{ matrix.environment.elixir-version }}-${{ matrix.environment.otp-version }}-plt
path: |
priv/plts
- name: Create PLTs
if: steps.plt_cache.outputs.cache-hit != 'true'
run: mix dialyzer --plt
env:
MIX_ENV: test
- name: Run dialyzer
run: mix dialyzer --format github
env:
MIX_ENV: test
build:
runs-on: ubuntu-20.04
name: Build and Test on Elixir ${{matrix.environment.elixir-version}} / OTP ${{matrix.environment.otp-version}}
strategy:
matrix:
environment:
- elixir-version: 1.15
otp-version: 25.0.4
- elixir-version: 1.14
otp-version: 25.0.4
- elixir-version: 1.13
otp-version: 24.3.4
- elixir-version: 1.12
otp-version: 23.3.4
- elixir-version: 1.11
otp-version: 23.3.4
- elixir-version: '1.10'
otp-version: 22.3.4
- elixir-version: 1.9
otp-version: 22.3.4
- elixir-version: 1.8
otp-version: 21.3.8
- elixir-version: 1.7
otp-version: 21.3.8
steps:
- uses: actions/checkout@v3
- name: Set up Elixir
uses: erlef/setup-beam@988e02bfe678367a02564f65ca2e37726dc0268f
with: ${{matrix.environment}}
- name: Restore dependencies cache
uses: actions/cache@v3
with:
path: deps/
key: deps-${{ runner.os }}-${{ matrix.environment.otp-version }}-${{ matrix.environment.elixir-version }}-${{ hashFiles('**/mix.lock') }}
- name: Restore build cache
uses: actions/cache@v3
with:
path: _build/test/
key: build-${{ runner.os }}-${{ matrix.environment.otp-version }}-${{ matrix.environment.elixir-version }}-${{ hashFiles('**/mix.lock') }}
- name: Install dependencies
run: |
mix local.rebar --force
mix local.hex --force
mix deps.get
mix compile
- name: Run tests with coverage
if: matrix.environment.elixir-version == '1.15'
run: mix coveralls.github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MIX_ENV: test
- name: Run tests
if: matrix.environment.elixir-version != '1.15'
run: mix test
env:
MIX_ENV: test