1717
1818 strategy :
1919 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
2231
2332 steps :
2433 - name : Checkout code
@@ -64,16 +73,25 @@ jobs:
6473 - name : Run Credo
6574 run : mix credo --strict
6675
67- static-analisys :
76+ static-analysis :
6877 runs-on : ubuntu-latest
6978
7079 env :
7180 MIX_ENV : test
7281
7382 strategy :
7483 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
7795
7896 steps :
7997 - name : Checkout code
@@ -110,29 +128,25 @@ jobs:
110128 if : steps.build-cache.outputs.cache-hit != 'true'
111129 run : mix deps.compile --warnings-as-errors
112130
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
117138 id : plt_cache
118139 with :
119- key : ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-plt
120- restore-keys : ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-plt
121140 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 }}-
122144
123145 # Create PLTs if no cache was found
124146 - name : Create PLTs
125147 if : steps.plt_cache.outputs.cache-hit != 'true'
126148 run : mix dialyzer --plt
127149
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-
136150 - name : Run dialyzer
137151 run : mix dialyzer --format github
138152
@@ -144,8 +158,17 @@ jobs:
144158
145159 strategy :
146160 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
149172
150173 steps :
151174 - name : Checkout code
@@ -186,4 +209,4 @@ jobs:
186209 run : mix clean
187210
188211 - name : Run tests
189- run : mix test
212+ run : mix test --warnings-as-errors
0 commit comments