25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-20 16:15:59 +01:00

Runtime: Try using elixir container for Rebar3+Elixir and Mix jobs (#4281)

This commit is contained in:
Badlop 2024-11-12 13:45:22 +01:00
parent d3baacd78e
commit c20ed8c7b3

View File

@ -158,50 +158,20 @@ jobs:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
otp: ['23.0', '25', '26', '27'] elixir: ['1.13', '1.14', '1.15', '1.16', '1.17']
elixir: ['1.13', '1.15', '1.16', '1.17'] runs-on: ubuntu-24.04
exclude: container:
- otp: '23.0' image: elixir:${{ matrix.elixir }}
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
steps: steps:
- uses: actions/checkout@v4 - 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 - name: Prepare libraries
run: | run: |
sudo apt-get -qq update apt-get -qq update
sudo apt-get -y purge libgd3 nginx apt-get -y purge libgd3 nginx
sudo apt-get -qq install libexpat1-dev libgd-dev libpam0g-dev \ apt-get -qq install libexpat1-dev libgd-dev libpam0g-dev \
libsqlite3-dev libwebp-dev libyaml-dev libsqlite3-dev libwebp-dev libyaml-dev
- name: Enable ModPresenceDemo and an Elixir dependency - name: Enable ModPresenceDemo and an Elixir dependency
@ -216,7 +186,13 @@ jobs:
with: with:
path: | path: |
~/.cache/rebar3/ ~/.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 - name: Compile
run: | run: |
@ -305,40 +281,20 @@ jobs:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
otp: ['23.0', '25', '26', '27'] elixir: ['1.13', '1.14', '1.15', '1.16', '1.17']
elixir: ['1.13', '1.15', '1.16', '1.17'] runs-on: ubuntu-24.04
exclude: container:
- otp: '23.0' image: elixir:${{ matrix.elixir }}
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
steps: steps:
- uses: actions/checkout@v4 - 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 - name: Prepare libraries
run: | run: |
sudo apt-get -qq update apt-get -qq update
sudo apt-get -y purge libgd3 nginx apt-get -y purge libgd3 nginx
sudo apt-get -qq install libexpat1-dev libgd-dev libpam0g-dev \ apt-get -qq install libexpat1-dev libgd-dev libpam0g-dev \
libsqlite3-dev libwebp-dev libyaml-dev libsqlite3-dev libwebp-dev libyaml-dev
- name: Remove Elixir Matchers - name: Remove Elixir Matchers
@ -356,17 +312,18 @@ jobs:
sed -i 's|^{deps, \(.*\)|{deps, \1\n {decimal, ".*", {git, "https://github.com/ericmj/decimal", {branch, "main"}}}, |g' rebar.config sed -i 's|^{deps, \(.*\)|{deps, \1\n {decimal, ".*", {git, "https://github.com/ericmj/decimal", {branch, "main"}}}, |g' rebar.config
cat 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 - name: Cache Hex.pm
uses: actions/cache@v4 uses: actions/cache@v4
with: with:
path: | path: |
~/.hex/ ~/.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 - name: Compile
run: | run: |