17
17
18
18
strategy :
19
19
matrix :
20
- elixir : [1.18.1]
21
- otp : [27.0]
20
+ include :
21
+ - elixir : 1.18
22
+ otp : 27
23
+ - elixir : 1.18
24
+ otp : 26
25
+ - elixir : 1.17
26
+ otp : 27
27
+ - elixir : 1.17
28
+ otp : 26
29
+ - elixir : 1.17
30
+ otp : 25
22
31
23
32
steps :
24
33
- name : Checkout code
@@ -31,14 +40,14 @@ jobs:
31
40
otp-version : ${{ matrix.otp }}
32
41
33
42
- name : Cache Elixir deps
34
- uses : actions/cache@v1
43
+ uses : actions/cache@v4
35
44
id : deps-cache
36
45
with :
37
46
path : deps
38
47
key : ${{ runner.os }}-mix-${{ env.MIX_ENV }}-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
39
48
40
49
- name : Cache Elixir _build
41
- uses : actions/cache@v1
50
+ uses : actions/cache@v4
42
51
id : build-cache
43
52
with :
44
53
path : _build
@@ -64,16 +73,25 @@ jobs:
64
73
- name : Run Credo
65
74
run : mix credo --strict
66
75
67
- static-analisys :
76
+ static-analysis :
68
77
runs-on : ubuntu-latest
69
78
70
79
env :
71
80
MIX_ENV : test
72
81
73
82
strategy :
74
83
matrix :
75
- elixir : [1.18.1]
76
- otp : [27.0]
84
+ include :
85
+ - elixir : 1.18
86
+ otp : 27
87
+ - elixir : 1.18
88
+ otp : 26
89
+ - elixir : 1.17
90
+ otp : 27
91
+ - elixir : 1.17
92
+ otp : 26
93
+ - elixir : 1.17
94
+ otp : 25
77
95
78
96
steps :
79
97
- name : Checkout code
@@ -86,14 +104,14 @@ jobs:
86
104
otp-version : ${{ matrix.otp }}
87
105
88
106
- name : Cache Elixir deps
89
- uses : actions/cache@v1
107
+ uses : actions/cache@v4
90
108
id : deps-cache
91
109
with :
92
110
path : deps
93
111
key : ${{ runner.os }}-mix-${{ env.MIX_ENV }}-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
94
112
95
113
- name : Cache Elixir _build
96
- uses : actions/cache@v1
114
+ uses : actions/cache@v4
97
115
id : build-cache
98
116
with :
99
117
path : _build
@@ -110,29 +128,25 @@ jobs:
110
128
if : steps.build-cache.outputs.cache-hit != 'true'
111
129
run : mix deps.compile --warnings-as-errors
112
130
113
- # Don't cache PLTs based on mix.lock hash, as Dialyzer can incrementally update even old ones
114
- # Cache key based on Elixir & Erlang version (also useful when running in matrix)
115
- - name : Restore PLT cache
116
- uses : actions/cache/restore@v3
131
+ # Ensure PLTs directory exists
132
+ - name : Create PLTs directory
133
+ run : mkdir -p priv/plts
134
+
135
+ # Cache PLTs based on Elixir & Erlang version + mix.lock hash
136
+ - name : Restore/Save PLT cache
137
+ uses : actions/cache@v4
117
138
id : plt_cache
118
139
with :
119
- key : ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-plt
120
- restore-keys : ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-plt
121
140
path : priv/plts
141
+ key : plt-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('mix.lock') }}
142
+ restore-keys : |
143
+ plt-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-
122
144
123
145
# Create PLTs if no cache was found
124
146
- name : Create PLTs
125
147
if : steps.plt_cache.outputs.cache-hit != 'true'
126
148
run : mix dialyzer --plt
127
149
128
- - name : Save PLT cache
129
- uses : actions/cache/save@v3
130
- if : steps.plt_cache.outputs.cache-hit != 'true'
131
- id : plt_cache_save
132
- with :
133
- key : ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-plt
134
- path : priv/plts
135
-
136
150
- name : Run dialyzer
137
151
run : mix dialyzer --format github
138
152
@@ -144,8 +158,17 @@ jobs:
144
158
145
159
strategy :
146
160
matrix :
147
- elixir : [1.18.1]
148
- otp : [27.0]
161
+ include :
162
+ - elixir : 1.18
163
+ otp : 27
164
+ - elixir : 1.18
165
+ otp : 26
166
+ - elixir : 1.17
167
+ otp : 27
168
+ - elixir : 1.17
169
+ otp : 26
170
+ - elixir : 1.17
171
+ otp : 25
149
172
150
173
steps :
151
174
- name : Checkout code
@@ -158,14 +181,14 @@ jobs:
158
181
otp-version : ${{ matrix.otp }}
159
182
160
183
- name : Cache Elixir deps
161
- uses : actions/cache@v1
184
+ uses : actions/cache@v4
162
185
id : deps-cache
163
186
with :
164
187
path : deps
165
188
key : ${{ runner.os }}-mix-${{ env.MIX_ENV }}-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
166
189
167
190
- name : Cache Elixir _build
168
- uses : actions/cache@v1
191
+ uses : actions/cache@v4
169
192
id : build-cache
170
193
with :
171
194
path : _build
@@ -186,4 +209,4 @@ jobs:
186
209
run : mix clean
187
210
188
211
- name : Run tests
189
- run : mix test
212
+ run : mix test --warnings-as-errors
0 commit comments