Skip to content

Commit c20ed8c

Browse files
committed
Runtime: Try using elixir container for Rebar3+Elixir and Mix jobs (#4281)
1 parent d3baacd commit c20ed8c

File tree

1 file changed

+30
-73
lines changed

1 file changed

+30
-73
lines changed

.github/workflows/runtime.yml

+30-73
Original file line numberDiff line numberDiff line change
@@ -158,51 +158,21 @@ jobs:
158158
strategy:
159159
fail-fast: false
160160
matrix:
161-
otp: ['23.0', '25', '26', '27']
162-
elixir: ['1.13', '1.15', '1.16', '1.17']
163-
exclude:
164-
- otp: '23.0'
165-
elixir: '1.15'
166-
- otp: '23.0'
167-
elixir: '1.16'
168-
- otp: '23.0'
169-
elixir: '1.17'
170-
- otp: '26'
171-
elixir: '1.13'
172-
- otp: '27'
173-
elixir: '1.13'
174-
- otp: '27'
175-
elixir: '1.15'
176-
- otp: '27'
177-
elixir: '1.16'
178-
runs-on: ubuntu-20.04
161+
elixir: ['1.13', '1.14', '1.15', '1.16', '1.17']
162+
runs-on: ubuntu-24.04
163+
container:
164+
image: elixir:${{ matrix.elixir }}
179165

180166
steps:
181167

182168
- uses: actions/checkout@v4
183169

184-
- name: Get specific Erlang/OTP
185-
uses: erlef/setup-beam@v1
186-
with:
187-
otp-version: ${{matrix.otp}}
188-
elixir-version: ${{matrix.elixir}}
189-
190-
- name: Get compatible Rebar binaries
191-
if: matrix.otp < 24
192-
run: |
193-
rm rebar
194-
rm rebar3
195-
wget https://github.com/processone/ejabberd/raw/21.12/rebar
196-
wget https://github.com/processone/ejabberd/raw/21.12/rebar3
197-
chmod +x rebar
198-
chmod +x rebar3
199-
200170
- name: Prepare libraries
201171
run: |
202-
sudo apt-get -qq update
203-
sudo apt-get -y purge libgd3 nginx
204-
sudo apt-get -qq install libexpat1-dev libgd-dev libpam0g-dev \
205-
libsqlite3-dev libwebp-dev libyaml-dev
172+
apt-get -qq update
173+
apt-get -y purge libgd3 nginx
174+
apt-get -qq install libexpat1-dev libgd-dev libpam0g-dev \
175+
libsqlite3-dev libwebp-dev libyaml-dev
206176
207177
- name: Enable ModPresenceDemo and an Elixir dependency
208178
run: |
@@ -216,7 +186,13 @@ jobs:
216186
with:
217187
path: |
218188
~/.cache/rebar3/
219-
key: ${{matrix.otp}}-${{hashFiles('rebar.config')}}
189+
key: ${{matrix.elixir}}-${{hashFiles('rebar.config')}}
190+
191+
- name: Install Hex and Rebar3 manually on older Elixir
192+
if: matrix.elixir <= '1.14'
193+
run: |
194+
mix local.hex --force
195+
mix local.rebar --force
220196
221197
- name: Compile
222198
run: |
@@ -305,41 +281,21 @@ jobs:
305281
strategy:
306282
fail-fast: false
307283
matrix:
308-
otp: ['23.0', '25', '26', '27']
309-
elixir: ['1.13', '1.15', '1.16', '1.17']
310-
exclude:
311-
- otp: '23.0'
312-
elixir: '1.15'
313-
- otp: '23.0'
314-
elixir: '1.16'
315-
- otp: '23.0'
316-
elixir: '1.17'
317-
- otp: '26'
318-
elixir: '1.13'
319-
- otp: '27'
320-
elixir: '1.13'
321-
- otp: '27'
322-
elixir: '1.15'
323-
- otp: '27'
324-
elixir: '1.16'
325-
runs-on: ubuntu-20.04
284+
elixir: ['1.13', '1.14', '1.15', '1.16', '1.17']
285+
runs-on: ubuntu-24.04
286+
container:
287+
image: elixir:${{ matrix.elixir }}
326288

327289
steps:
328290

329291
- uses: actions/checkout@v4
330292

331-
- name: Get specific Erlang/OTP
332-
uses: erlef/setup-beam@v1
333-
with:
334-
otp-version: ${{matrix.otp}}
335-
elixir-version: ${{matrix.elixir}}
336-
337293
- name: Prepare libraries
338294
run: |
339-
sudo apt-get -qq update
340-
sudo apt-get -y purge libgd3 nginx
341-
sudo apt-get -qq install libexpat1-dev libgd-dev libpam0g-dev \
342-
libsqlite3-dev libwebp-dev libyaml-dev
295+
apt-get -qq update
296+
apt-get -y purge libgd3 nginx
297+
apt-get -qq install libexpat1-dev libgd-dev libpam0g-dev \
298+
libsqlite3-dev libwebp-dev libyaml-dev
343299
344300
- name: Remove Elixir Matchers
345301
run: |
@@ -356,17 +312,18 @@ jobs:
356312
sed -i 's|^{deps, \(.*\)|{deps, \1\n {decimal, ".*", {git, "https://github.com/ericmj/decimal", {branch, "main"}}}, |g' rebar.config
357313
cat rebar.config
358314
359-
- name: Unlock Jose dependency on older Erlang
360-
if: matrix.otp < 24
361-
run: |
362-
mix deps.unlock jose
363-
364315
- name: Cache Hex.pm
365316
uses: actions/cache@v4
366317
with:
367318
path: |
368319
~/.hex/
369-
key: ${{matrix.otp}}-${{hashFiles('mix.exs')}}
320+
key: ${{matrix.elixir}}-${{hashFiles('mix.exs')}}
321+
322+
- name: Install Hex and Rebar3 manually on older Elixir
323+
if: matrix.elixir <= '1.14'
324+
run: |
325+
mix local.hex --force
326+
mix local.rebar --force
370327
371328
- name: Compile
372329
run: |

0 commit comments

Comments
 (0)