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.3', '25.3'] runs-on: ubuntu-latest container: image: erlang:${{ matrix.otp }} steps: - name: Checkout ejabberd uses: actions/checkout@v3 with: repository: processone/ejabberd - name: Checkout ejabberd-contrib uses: actions/checkout@v3 with: path: .ejabberd-modules/sources/ejabberd-contrib - name: Get a compatible Rebar3 if: matrix.otp <= '21.3' 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 '{xref_checks, [deprecated_function_calls, deprecated_functions, locals_not_used, undefined_function_calls, undefined_functions]}. % Disabled: exports_not_used,' >>rebar.config echo '{dialyzer, [{get_warnings, true}, {plt_extra_apps, [cache_tab, eimp, epam, esip, ezlib, fast_tls, fast_xml, fast_yaml, mqtree, p1_acme, p1_mysql, p1_oauth2, p1_pgsql, p1_utils, pkix, sqlite3, stringprep, stun, xmpp, yconf]} ]}.' >>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@v3 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}' | grep -v mod_captcha_rust >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 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/' ';' find .ejabberd-modules/sources/ejabberd-contrib/ -wholename "*/ejabberd-contrib/$i/deps/*/ebin/*.beam" -exec 'cp' '{}' '_build/default/lib/ejabberd/ebin/' ';' find .ejabberd-modules/sources/ejabberd-contrib/ -wholename "*/ejabberd-contrib/$i/deps/*/include/*.hrl" -exec 'cp' '{}' 'include/' ';' 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 - 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