Add dependencies used by mod_prometheus so Dialyzer testing succeeds #58
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: [21, 25, 26, 27] | |
runs-on: ubuntu-22.04 | |
container: | |
image: erlang:${{ matrix.otp }} | |
steps: | |
- name: Checkout ejabberd | |
uses: actions/checkout@v4 | |
with: | |
repository: processone/ejabberd | |
- name: Checkout ejabberd-contrib | |
uses: actions/checkout@v4 | |
with: | |
path: .ejabberd-modules/sources/ejabberd-contrib | |
- name: Get a compatible Rebar3 | |
if: matrix.otp <= 21 | |
run: | | |
rm rebar3 | |
wget https://github.com/processone/ejabberd/raw/21.12/rebar3 | |
chmod +x rebar3 | |
- name: Prepare libraries | |
run: | | |
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: 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/ | |
key: ${{matrix.otp}}-${{hashFiles('rebar.config')}} | |
- name: Compile | |
run: | | |
./autogen.sh | |
./configure --with-rebar=./rebar3 \ | |
--prefix=/tmp/ejabberd \ | |
--enable-all \ | |
--disable-elixir \ | |
--disable-mssql \ | |
--disable-odbc | |
make update | |
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, ".*", {git, "https://github.com/esl/fusco", {branch, "master"}}}, \ | |
{observer_cli, ".*", {git, "https://github.com/zhongwencool/observer_cli", {branch, "master"}}}, \ | |
{prometheus, ".*", {git, "https://github.com/deadtrickster/prometheus.erl", {branch, "master"}}}, \ | |
{quantile_estimator, ".*", {git, "https://github.com/deadtrickster/quantile_estimator", {branch, "master"}}}, \ | |
{recon, ".*", {git, "https://github.com/ferd/recon", {branch, "master"}}}, \ | |
|g' rebar.config | |
sed -i 's|stdlib, |stdlib, cuesport, ecaptcha, fusco, observer_cli, 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 # Too many errors... first fix them, then enable this | |
- 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 | |