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
22
25
23
26
steps :
24
27
- name : Checkout code
@@ -31,14 +34,14 @@ jobs:
31
34
otp-version : ${{ matrix.otp }}
32
35
33
36
- name : Cache Elixir deps
34
- uses : actions/cache@v1
37
+ uses : actions/cache@v4
35
38
id : deps-cache
36
39
with :
37
40
path : deps
38
41
key : ${{ runner.os }}-mix-${{ env.MIX_ENV }}-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
39
42
40
43
- name : Cache Elixir _build
41
- uses : actions/cache@v1
44
+ uses : actions/cache@v4
42
45
id : build-cache
43
46
with :
44
47
path : _build
@@ -64,16 +67,19 @@ jobs:
64
67
- name : Run Credo
65
68
run : mix credo --strict
66
69
67
- static-analisys :
70
+ static-analysis :
68
71
runs-on : ubuntu-latest
69
72
70
73
env :
71
74
MIX_ENV : test
72
75
73
76
strategy :
74
77
matrix :
75
- elixir : [1.18.1]
76
- otp : [27.0]
78
+ include :
79
+ - elixir : 1.18
80
+ otp : 27
81
+ - elixir : 1.18
82
+ otp : 26
77
83
78
84
steps :
79
85
- name : Checkout code
@@ -86,14 +92,14 @@ jobs:
86
92
otp-version : ${{ matrix.otp }}
87
93
88
94
- name : Cache Elixir deps
89
- uses : actions/cache@v1
95
+ uses : actions/cache@v4
90
96
id : deps-cache
91
97
with :
92
98
path : deps
93
99
key : ${{ runner.os }}-mix-${{ env.MIX_ENV }}-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
94
100
95
101
- name : Cache Elixir _build
96
- uses : actions/cache@v1
102
+ uses : actions/cache@v4
97
103
id : build-cache
98
104
with :
99
105
path : _build
@@ -110,29 +116,25 @@ jobs:
110
116
if : steps.build-cache.outputs.cache-hit != 'true'
111
117
run : mix deps.compile --warnings-as-errors
112
118
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
119
+ # Ensure PLTs directory exists
120
+ - name : Create PLTs directory
121
+ run : mkdir -p priv/plts
122
+
123
+ # Cache PLTs based on Elixir & Erlang version + mix.lock hash
124
+ - name : Restore/Save PLT cache
125
+ uses : actions/cache@v4
117
126
id : plt_cache
118
127
with :
119
- key : ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-plt
120
- restore-keys : ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-plt
121
128
path : priv/plts
129
+ key : plt-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('mix.lock') }}
130
+ restore-keys : |
131
+ plt-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-
122
132
123
133
# Create PLTs if no cache was found
124
134
- name : Create PLTs
125
135
if : steps.plt_cache.outputs.cache-hit != 'true'
126
136
run : mix dialyzer --plt
127
137
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
138
- name : Run dialyzer
137
139
run : mix dialyzer --format github
138
140
@@ -144,8 +146,11 @@ jobs:
144
146
145
147
strategy :
146
148
matrix :
147
- elixir : [1.18.1]
148
- otp : [27.0]
149
+ include :
150
+ - elixir : 1.18
151
+ otp : 27
152
+ - elixir : 1.18
153
+ otp : 26
149
154
150
155
steps :
151
156
- name : Checkout code
@@ -158,14 +163,14 @@ jobs:
158
163
otp-version : ${{ matrix.otp }}
159
164
160
165
- name : Cache Elixir deps
161
- uses : actions/cache@v1
166
+ uses : actions/cache@v4
162
167
id : deps-cache
163
168
with :
164
169
path : deps
165
170
key : ${{ runner.os }}-mix-${{ env.MIX_ENV }}-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
166
171
167
172
- name : Cache Elixir _build
168
- uses : actions/cache@v1
173
+ uses : actions/cache@v4
169
174
id : build-cache
170
175
with :
171
176
path : _build
@@ -186,4 +191,4 @@ jobs:
186
191
run : mix clean
187
192
188
193
- name : Run tests
189
- run : mix test
194
+ run : mix test --warnings-as-errors
0 commit comments