Skip to content

CI: Test only with recent stable erlang and elixir versions #64

CI: Test only with recent stable erlang and elixir versions

CI: Test only with recent stable erlang and elixir versions #64

Workflow file for this run

name: CI
on:
push:
paths-ignore:
- '**.md'
- '**.spec'
- '**.txt'
- '*/conf/*.yml'
pull_request:
paths-ignore:
- '**.md'
- '**.spec'
- '**.txt'
- '*/conf/*.yml'
jobs:
tests:
name: Tests
strategy:
fail-fast: false
matrix:
otp: [25, 26, 27]
elixir: ['1.17']
runs-on: ubuntu-20.04
steps:
- name: Checkout ejabberd
uses: actions/checkout@v4
with:
repository: processone/ejabberd
- name: Get specific Erlang/OTP
uses: erlef/setup-beam@v1
with:
otp-version: ${{matrix.otp}}
elixir-version: ${{matrix.elixir}}
- name: Checkout ejabberd-contrib
uses: actions/checkout@v4
with:
path: .ejabberd-modules/sources/ejabberd-contrib
- 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
- name: Prepare rebar
id: rebar
run: |
echo '{xref_ignores, [{eldap_filter_yecc, return_error, 2},
{fusco_lib, split_credentials, 1},
{http_uri, encode, 1},
{http_uri, decode, 1}
]}.' >>rebar.config
echo '{ct_extra_params, "-verbosity 20"}.' >>rebar.config
- name: Remove syntax_tools from release
run: sed -i 's|, syntax_tools||g' src/ejabberd.app.src.script
- name: Cache rebar
uses: actions/cache@v4
with:
path: |
~/.cache/rebar3/
~/.hex/
~/.mix/
key: ${{matrix.otp}}-${{hashFiles('rebar.config')}}
- name: Compile
run: |
./autogen.sh
./configure --with-rebar=./rebar3 \
--prefix=/tmp/ejabberd \
--enable-all \
--disable-mssql \
--disable-odbc
make
- name: Start ejabberd
run: |
echo "CONTRIB_MODULES_PATH=`pwd`/.ejabberd-modules" >> ejabberdctl.cfg.example
CTL=_build/dev/rel/ejabberd/bin/ejabberdctl
make dev
$CTL start
$CTL started
- name: Enable mod_muc_log
run: |
echo ' mod_muc_log: {}' >>.ejabberd-modules/sources/ejabberd-contrib/mod_muc_log_http/conf/mod_muc_log_http.yml
- name: Get list of available modules
run: |
CTL=_build/dev/rel/ejabberd/bin/ejabberdctl
$CTL modules_available | awk '{print $1}' >modules_available.txt
- name: Disable mod_captcha_rust testing
run: sed -i '/mod_captcha_rust/d' modules_available.txt
- name: Disable mod_s3_upload testing with old OTP
if: matrix.otp < 25
run: sed -i '/mod_s3_upload/d' modules_available.txt
- name: Install modules
run: |
CTL=_build/dev/rel/ejabberd/bin/ejabberdctl
for i in `cat modules_available.txt` ; do
echo "Installing $i"
$CTL module_install $i
done
- name: Copy modules source code
run: |
CTL=_build/dev/rel/ejabberd/bin/ejabberdctl
for i in `cat modules_available.txt` ; do
echo "Copying from $i"
find .ejabberd-modules/sources/ejabberd-contrib/ -wholename "*/ejabberd-contrib/$i/include/*.hrl" -exec 'cp' '{}' 'include/' ';'
find .ejabberd-modules/sources/ejabberd-contrib/ -wholename "*/ejabberd-contrib/$i/src/*.erl" -exec 'cp' '{}' 'src/' ';'
done
- name: Uninstall modules
run: |
CTL=_build/dev/rel/ejabberd/bin/ejabberdctl
for i in `cat modules_available.txt` ; do
echo "Uninstalling $i"
$CTL module_uninstall $i
done
# This doesn't work right now, because epmd is in another path
# - run: ./ejabberdctl stop && ./ejabberdctl stopped
- name: Setup dependencies
run: |
sed -i 's|{deps, \[|{deps, \[ \
{cuesport, ".*", {git, "https://github.com/goj/cuesport", {branch, "master"}}}, \
{ecaptcha, ".*", {git, "https://github.com/seriyps/ecaptcha", {branch, "master"}}}, \
{fusco, "0.1.1", {git, "https://github.com/esl/fusco", {branch, "master"}}}, \
{observer_cli, ".*", {git, "https://github.com/zhongwencool/observer_cli", {branch, "master"}}}, \
{prometheus, "1.44.0", {git, "https://github.com/deadtrickster/prometheus.erl", {branch, "master"}}}, \
{quantile_estimator, "0.2.1", {git, "https://github.com/deadtrickster/quantile_estimator", {branch, "master"}}}, \
{recon, "2.5.5", {git, "https://github.com/ferd/recon", {branch, "master"}}}, \
|g' rebar.config
sed -i 's|stdlib, |stdlib, cuesport, ecaptcha, fusco, observer_cli, prometheus, recon, |g' rebar.config
- run: make
- run: make hooks
- run: make options
- run: make xref
- name: Run Dialyzer
if: always()
run: |
rm -rf _build/default/lib/ejabberd/ebin/fusco*
rm -rf _build/default/lib/ejabberd/ebin/observer_cli*
make dialyzer
- name: View logs dir
if: always()
run: ls -la _build/dev/rel/ejabberd/logs
- name: View ejabberd.log
if: always()
run: cat _build/dev/rel/ejabberd/logs/ejabberd.log
- name: View error.log
if: always()
run: cat _build/dev/rel/ejabberd/logs/error.log