Skip to content

Commit

Permalink
Runtime: Try using elixir container for Rebar3+Elixir and Mix jobs (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
badlop committed Nov 14, 2024
1 parent d3baacd commit c20ed8c
Showing 1 changed file with 30 additions and 73 deletions.
103 changes: 30 additions & 73 deletions .github/workflows/runtime.yml
Original file line number Diff line number Diff line change
Expand Up @@ -158,51 +158,21 @@ jobs:
strategy:
fail-fast: false
matrix:
otp: ['23.0', '25', '26', '27']
elixir: ['1.13', '1.15', '1.16', '1.17']
exclude:
- otp: '23.0'
elixir: '1.15'
- otp: '23.0'
elixir: '1.16'
- otp: '23.0'
elixir: '1.17'
- otp: '26'
elixir: '1.13'
- otp: '27'
elixir: '1.13'
- otp: '27'
elixir: '1.15'
- otp: '27'
elixir: '1.16'
runs-on: ubuntu-20.04
elixir: ['1.13', '1.14', '1.15', '1.16', '1.17']
runs-on: ubuntu-24.04
container:
image: elixir:${{ matrix.elixir }}

steps:

- uses: actions/checkout@v4

- name: Get specific Erlang/OTP
uses: erlef/setup-beam@v1
with:
otp-version: ${{matrix.otp}}
elixir-version: ${{matrix.elixir}}

- name: Get compatible Rebar binaries
if: matrix.otp < 24
run: |
rm rebar
rm rebar3
wget https://github.com/processone/ejabberd/raw/21.12/rebar
wget https://github.com/processone/ejabberd/raw/21.12/rebar3
chmod +x rebar
chmod +x rebar3
- name: Prepare libraries
run: |
sudo apt-get -qq update
sudo apt-get -y purge libgd3 nginx
sudo apt-get -qq install libexpat1-dev libgd-dev libpam0g-dev \
libsqlite3-dev libwebp-dev libyaml-dev
apt-get -qq update
apt-get -y purge libgd3 nginx
apt-get -qq install libexpat1-dev libgd-dev libpam0g-dev \
libsqlite3-dev libwebp-dev libyaml-dev
- name: Enable ModPresenceDemo and an Elixir dependency
run: |
Expand All @@ -216,7 +186,13 @@ jobs:
with:
path: |
~/.cache/rebar3/
key: ${{matrix.otp}}-${{hashFiles('rebar.config')}}
key: ${{matrix.elixir}}-${{hashFiles('rebar.config')}}

- name: Install Hex and Rebar3 manually on older Elixir
if: matrix.elixir <= '1.14'
run: |
mix local.hex --force
mix local.rebar --force
- name: Compile
run: |
Expand Down Expand Up @@ -305,41 +281,21 @@ jobs:
strategy:
fail-fast: false
matrix:
otp: ['23.0', '25', '26', '27']
elixir: ['1.13', '1.15', '1.16', '1.17']
exclude:
- otp: '23.0'
elixir: '1.15'
- otp: '23.0'
elixir: '1.16'
- otp: '23.0'
elixir: '1.17'
- otp: '26'
elixir: '1.13'
- otp: '27'
elixir: '1.13'
- otp: '27'
elixir: '1.15'
- otp: '27'
elixir: '1.16'
runs-on: ubuntu-20.04
elixir: ['1.13', '1.14', '1.15', '1.16', '1.17']
runs-on: ubuntu-24.04
container:
image: elixir:${{ matrix.elixir }}

steps:

- uses: actions/checkout@v4

- name: Get specific Erlang/OTP
uses: erlef/setup-beam@v1
with:
otp-version: ${{matrix.otp}}
elixir-version: ${{matrix.elixir}}

- name: Prepare libraries
run: |
sudo apt-get -qq update
sudo apt-get -y purge libgd3 nginx
sudo apt-get -qq install libexpat1-dev libgd-dev libpam0g-dev \
libsqlite3-dev libwebp-dev libyaml-dev
apt-get -qq update
apt-get -y purge libgd3 nginx
apt-get -qq install libexpat1-dev libgd-dev libpam0g-dev \
libsqlite3-dev libwebp-dev libyaml-dev
- name: Remove Elixir Matchers
run: |
Expand All @@ -356,17 +312,18 @@ jobs:
sed -i 's|^{deps, \(.*\)|{deps, \1\n {decimal, ".*", {git, "https://github.com/ericmj/decimal", {branch, "main"}}}, |g' rebar.config
cat rebar.config
- name: Unlock Jose dependency on older Erlang
if: matrix.otp < 24
run: |
mix deps.unlock jose
- name: Cache Hex.pm
uses: actions/cache@v4
with:
path: |
~/.hex/
key: ${{matrix.otp}}-${{hashFiles('mix.exs')}}
key: ${{matrix.elixir}}-${{hashFiles('mix.exs')}}

- name: Install Hex and Rebar3 manually on older Elixir
if: matrix.elixir <= '1.14'
run: |
mix local.hex --force
mix local.rebar --force
- name: Compile
run: |
Expand Down

0 comments on commit c20ed8c

Please sign in to comment.