diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index d95bcc15563..00000000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,308 +0,0 @@ -name: CI - -on: - push: - paths-ignore: - - '.devcontainer/**' - - 'examples/**' - - 'lib/**' - - 'man/**' - - 'priv/**' - - '**.md' - pull_request: - paths-ignore: - - '.devcontainer/**' - - 'examples/**' - - 'lib/**' - - 'man/**' - - 'priv/**' - - '**.md' - -jobs: - - tests: - name: Tests - strategy: - fail-fast: false - matrix: - otp: ['20.0', '25', '26', '27'] - runs-on: ubuntu-20.04 - services: - redis: - image: redis - ports: - - 6379:6379 - - steps: - - - uses: actions/checkout@v4 - - - name: Test shell scripts - if: matrix.otp == '27' - run: | - shellcheck test/ejabberd_SUITE_data/gencerts.sh - shellcheck tools/captcha.sh - shellcheck ejabberd.init.template - shellcheck -x ejabberdctl.template - - - name: Get specific Erlang/OTP - uses: erlef/setup-beam@v1 - with: - otp-version: ${{ matrix.otp }} - - - name: Get a compatible Rebar3 - if: matrix.otp < 24 - run: | - rm rebar3 - wget https://github.com/processone/ejabberd/raw/21.12/rebar3 - chmod +x rebar3 - - - name: Install MS SQL Server - run: | - docker run -d -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=ejabberd_Test1" \ - -v $(pwd)/test/docker/db/mssql/initdb/initdb_mssql.sql:/initdb_mssql.sql:ro \ - -v $(pwd)/sql/mssql.sql:/mssql.sql:ro \ - -v $(pwd)/sql/mssql.new.sql:/mssql.new.sql:ro \ - -p 1433:1433 --name ejabberd-mssql "mcr.microsoft.com/mssql/server:2019-latest" - sleep 10 - - - name: Prepare databases - run: | - docker exec ejabberd-mssql /opt/mssql-tools18/bin/sqlcmd -C -U SA -P ejabberd_Test1 -S localhost -i /initdb_mssql.sql - docker exec ejabberd-mssql /opt/mssql-tools18/bin/sqlcmd -C -U SA -P ejabberd_Test1 -S localhost -d ejabberd_test -i /mssql.sql - sudo systemctl start mysql.service - sudo systemctl start postgresql.service - mysql -u root -proot -e "CREATE DATABASE ejabberd_test;" - mysql -u root -proot -e "CREATE USER 'ejabberd_test'@'localhost' - IDENTIFIED BY 'ejabberd_test';" - mysql -u root -proot -e "GRANT ALL ON ejabberd_test.* - TO 'ejabberd_test'@'localhost';" - pg_isready - sudo -u postgres psql -c "CREATE DATABASE ejabberd_test;" - sudo -u postgres psql -c "CREATE USER ejabberd_test - WITH PASSWORD 'ejabberd_test';" - sudo -u postgres psql -c "GRANT ALL PRIVILEGES - ON DATABASE ejabberd_test TO ejabberd_test;" - sudo -u postgres psql ejabberd_test -c "GRANT ALL PRIVILEGES ON ALL - TABLES IN SCHEMA public - TO ejabberd_test;" - sudo -u postgres psql ejabberd_test -c "GRANT ALL PRIVILEGES ON ALL - SEQUENCES IN SCHEMA public - TO ejabberd_test;" - - - 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: Remove syntax_tools from release - run: sed -i 's|, syntax_tools||g' src/ejabberd.app.src.script - - - name: Cache Hex.pm - uses: actions/cache@v4 - with: - path: | - ~/.cache/rebar3/ - key: ${{matrix.otp}}-${{hashFiles('rebar.config')}} - - - name: Get compatible Rebar binaries - if: matrix.otp < 21 - run: ./rebar3 unlock eredis - - - name: Compile - run: | - ./autogen.sh - ./configure --with-rebar=./rebar3 \ - --prefix=/tmp/ejabberd \ - --enable-all \ - --disable-elixir \ - --disable-mssql \ - --disable-odbc - make - - - run: make install -s - - run: make hooks - - run: make options - - run: make xref - - run: make dialyzer - - run: make test-eunit - - run: make elvis - if: matrix.otp >= 23 - - - name: Check Production Release - run: | - make rel - RE=_build/prod/rel/ejabberd - $RE/bin/ejabberdctl start - $RE/bin/ejabberdctl started - $RE/bin/ejabberdctl stop - $RE/bin/ejabberdctl stopped - cat $RE/logs/ejabberd.log - grep -q "is stopped in" $RE/logs/ejabberd.log - - - name: Start Development Release - run: | - make dev - RE=_build/dev/rel/ejabberd - sed -i 's/starttls_required: true/starttls_required: false/g' $RE/conf/ejabberd.yml - $RE/bin/ejabberdctl start - $RE/bin/ejabberdctl started - $RE/bin/ejabberdctl register admin localhost admin - grep -q "is started in" $RE/logs/ejabberd.log - - - name: Run XMPP Interoperability Tests against CI server. - if: matrix.otp == '27' - continue-on-error: true - uses: XMPP-Interop-Testing/xmpp-interop-tests-action@v1.4.0 - with: - domain: 'localhost' - adminAccountUsername: 'admin' - adminAccountPassword: 'admin' - disabledSpecifications: RFC6121,XEP-0030,XEP-0045,XEP-0054,XEP-0060,XEP-0080,XEP-0115,XEP-0118,XEP-0215,XEP-0347,XEP-0363,XEP-0384 - - - name: Stop Development Release - if: always() - run: | - RE=_build/dev/rel/ejabberd - $RE/bin/ejabberdctl stop - $RE/bin/ejabberdctl stopped - cat $RE/logs/ejabberd.log - grep -q "is stopped in" $RE/logs/ejabberd.log - - - name: Run tests - id: ct - run: | - (cd priv && ln -sf ../sql) - sed -i -e 's/ct:pal/ct:log/' test/suite.erl - COMMIT=`echo $GITHUB_SHA | cut -c 1-7` - DATE=`date +%s` - REF_NAME=`echo $GITHUB_REF_NAME | tr "/" "_"` - NODENAME=$DATE@$GITHUB_RUN_NUMBER-$GITHUB_ACTOR-$REF_NAME-$COMMIT - LABEL=`git show -s --format=%s | cut -c 1-30` - ./rebar3 ct --name $NODENAME --label "$LABEL" - ./rebar3 cover - - - name: Check results - if: always() && (steps.ct.outcome != 'skipped' || steps.ct2.outcome != 'skipped') - id: ctresults - run: | - [[ -d _build ]] && ln -s _build/test/logs/last/ logs || true - ln `find logs/ -name suite.log` logs/suite.log - grep 'TEST COMPLETE' logs/suite.log - grep -q 'TEST COMPLETE,.* 0 failed' logs/suite.log - test $(find logs/ -empty -name error.log) - - - name: View logs failures - if: failure() && steps.ctresults.outcome == 'failure' - run: | - cat logs/suite.log | awk \ - 'BEGIN{RS="\n=case";FS="\n"} /=result\s*failed/ {print "=case" $0}' - find logs/ -name error.log -exec cat '{}' ';' - find logs/ -name exunit.log -exec cat '{}' ';' - - - name: Send to coveralls - if: matrix.otp == '27' - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - DIAGNOSTIC=1 ./rebar3 as test coveralls send - curl -v -k https://coveralls.io/webhook \ - --header "Content-Type: application/json" \ - --data '{"repo_name":"$GITHUB_REPOSITORY", - "repo_token":"$GITHUB_TOKEN", - "payload":{"build_num":$GITHUB_RUN_ID, - "status":"done"}}' - - - name: Check for changes to trigger schema upgrade test - uses: dorny/paths-filter@v3 - id: filter - with: - filters: | - sql: - - 'sql/**' - - 'src/mod_admin_update_sql.erl' - - - name: Prepare for schema upgrade test - id: prepupgradetest - if: ${{ steps.filter.outputs.sql == 'true' }} - run: | - [[ -d logs ]] && rm -rf logs - [[ -d _build/test/logs ]] && rm -rf _build/test/logs || true - sed -i 's|update_sql, false|update_sql, true|g' test/suite.erl - - name: Run DB tests on upgraded schema (mssql, mysql, pgsql) - run: CT_BACKENDS=mssql,mysql,pgsql make test - if: always() && steps.prepupgradetest.outcome != 'skipped' - id: ctupgradedschema - - name: Check results - if: always() && steps.ctupgradedschema.outcome != 'skipped' - run: | - [[ -d _build ]] && ln -s _build/test/logs/last/ logs || true - ln `find logs/ -name suite.log` logs/suite.log - grep 'TEST COMPLETE' logs/suite.log - grep -q 'TEST COMPLETE,.* 0 failed' logs/suite.log - test $(find logs/ -empty -name error.log) - - name: View logs failures - if: failure() && steps.ctupgradedschema.outcome != 'skipped' - run: | - cat logs/suite.log | awk \ - 'BEGIN{RS="\n=case";FS="\n"} /=result\s*failed/ {print "=case" $0}' - find logs/ -name error.log -exec cat '{}' ';' - find logs/ -name exunit.log -exec cat '{}' ';' - - - name: Prepare new schema - run: | - [[ -d logs ]] && rm -rf logs - [[ -d _build/test/logs ]] && rm -rf _build/test/logs || true - docker exec ejabberd-mssql /opt/mssql-tools18/bin/sqlcmd -C -U SA -P ejabberd_Test1 -S localhost -Q "drop database [ejabberd_test];" - docker exec ejabberd-mssql /opt/mssql-tools18/bin/sqlcmd -C -U SA -P ejabberd_Test1 -S localhost -Q "drop login [ejabberd_test];" - mysql -u root -proot -e "DROP DATABASE ejabberd_test;" - sudo -u postgres psql -c "DROP DATABASE ejabberd_test;" - docker exec ejabberd-mssql /opt/mssql-tools18/bin/sqlcmd -C -U SA -P ejabberd_Test1 -S localhost -i /initdb_mssql.sql - docker exec ejabberd-mssql /opt/mssql-tools18/bin/sqlcmd -C -U SA -P ejabberd_Test1 -S localhost -d ejabberd_test -i /mssql.new.sql - mysql -u root -proot -e "CREATE DATABASE ejabberd_test;" - mysql -u root -proot -e "GRANT ALL ON ejabberd_test.* - TO 'ejabberd_test'@'localhost';" - sudo -u postgres psql -c "CREATE DATABASE ejabberd_test;" - sudo -u postgres psql -c "GRANT ALL PRIVILEGES - ON DATABASE ejabberd_test TO ejabberd_test;" - sudo -u postgres psql ejabberd_test -c "GRANT ALL PRIVILEGES ON ALL - TABLES IN SCHEMA public - TO ejabberd_test;" - sudo -u postgres psql ejabberd_test -c "GRANT ALL PRIVILEGES ON ALL - SEQUENCES IN SCHEMA public - TO ejabberd_test;" - sed -i 's|new_schema, false|new_schema, true|g' test/suite.erl - - name: Run DB tests on new schema (mssql, mysql, pgsql) - run: CT_BACKENDS=mssql,mysql,pgsql make test - id: ctnewschema - - name: Check results - if: always() && steps.ctnewschema.outcome != 'skipped' - run: | - [[ -d _build ]] && ln -s _build/test/logs/last/ logs || true - ln `find logs/ -name suite.log` logs/suite.log - grep 'TEST COMPLETE' logs/suite.log - grep -q 'TEST COMPLETE,.* 0 failed' logs/suite.log - test $(find logs/ -empty -name error.log) - - name: View logs failures - if: failure() && steps.ctnewschema.outcome != 'skipped' - run: | - cat logs/suite.log | awk \ - 'BEGIN{RS="\n=case";FS="\n"} /=result\s*failed/ {print "=case" $0}' - find logs/ -name error.log -exec cat '{}' ';' - find logs/ -name exunit.log -exec cat '{}' ';' - - - name: Upload CT logs - if: failure() - uses: actions/upload-artifact@v4 - with: - name: ejabberd-ct-logs-${{matrix.otp}} - # - # Appending the wildcard character ("*") is a trick to make - # "ejabberd-packages" the root directory of the uploaded ZIP file: - # - # https://github.com/actions/upload-artifact#upload-using-multiple-paths-and-exclusions - # - path: _build/test/logs - retention-days: 14 diff --git a/.github/workflows/installers.yml b/.github/workflows/installers.yml deleted file mode 100644 index b820dd6d9e4..00000000000 --- a/.github/workflows/installers.yml +++ /dev/null @@ -1,84 +0,0 @@ -name: Installers - -on: - push: - paths-ignore: - - '.devcontainer/**' - - 'examples/**' - - 'lib/**' - - 'man/**' - - 'priv/**' - - '**.md' - pull_request: - paths-ignore: - - '.devcontainer/**' - - 'examples/**' - - 'lib/**' - - 'man/**' - - 'priv/**' - - '**.md' - -jobs: - binaries: - name: Binaries - runs-on: ubuntu-22.04 - steps: - - name: Cache build directory - uses: actions/cache@v4 - with: - path: ~/build/ - key: ${{runner.os}}-ct-ng-1.26.0 - - name: Install prerequisites - run: | - sudo apt-get -qq update - sudo apt-get -qq install makeself - # https://github.com/crosstool-ng/crosstool-ng/blob/master/testing/docker/ubuntu21.10/Dockerfile - sudo apt-get -qq install build-essential autoconf bison flex gawk - sudo apt-get -qq install help2man libncurses5-dev libtool libtool-bin - sudo apt-get -qq install python3-dev texinfo unzip - - name: Install FPM - run: | - gem install --no-document --user-install fpm - echo $HOME/.local/share/gem/ruby/*/bin >> $GITHUB_PATH - - name: Check out repository code - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Build binary archives - run: CHECK_DEPS=false tools/make-binaries - - name: Build DEB and RPM packages - run: tools/make-packages - - name: Build installers - run: tools/make-installers - - name: Collect packages - run: | - mkdir ejabberd-packages - mv ejabberd_*.deb ejabberd-*.rpm ejabberd-*.run ejabberd-packages - - name: Upload packages - uses: actions/upload-artifact@v4 - with: - name: ejabberd-packages - # - # Appending the wildcard character ("*") is a trick to make - # "ejabberd-packages" the root directory of the uploaded ZIP file: - # - # https://github.com/actions/upload-artifact#upload-using-multiple-paths-and-exclusions - # - path: ejabberd-packages* - retention-days: 14 - - release: - name: Release - needs: [binaries] - runs-on: ubuntu-22.04 - if: github.ref_type == 'tag' - steps: - - name: Download packages - uses: actions/download-artifact@v4 - with: - name: ejabberd-packages - - name: Draft Release - uses: softprops/action-gh-release@v2 - with: - draft: true - files: ejabberd-packages/* diff --git a/.github/workflows/runtime.yml b/.github/workflows/runtime.yml deleted file mode 100644 index 076798aba96..00000000000 --- a/.github/workflows/runtime.yml +++ /dev/null @@ -1,418 +0,0 @@ -name: Runtime - -on: - push: - paths: - - '*' - - '!*.md' - - '.github/workflows/runtime.yml' - - 'checkouts/**' - - 'config/**' - - 'lib/**' - - 'm4/**' - - 'plugins/**' - - 'rel/**' - pull_request: - paths: - - '*' - - '!*.md' - - '.github/workflows/runtime.yml' - - 'checkouts/**' - - 'config/**' - - 'lib/**' - - 'm4/**' - - 'plugins/**' - - 'rel/**' - -jobs: - - rebars: - name: Rebars - strategy: - fail-fast: false - matrix: - otp: ['20', '25', '26', '27'] - rebar: ['rebar', 'rebar3'] - exclude: - - otp: '27' - rebar: 'rebar' - runs-on: ubuntu-24.04 - container: - image: erlang:${{ matrix.otp }} - - steps: - - - uses: actions/checkout@v4 - - - 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: | - apt-get -qq update - apt-get purge -y libgd3 nginx - apt-get -qq install libexpat1-dev libgd-dev libpam0g-dev \ - libsqlite3-dev libwebp-dev libyaml-dev - - - name: Cache Hex.pm - uses: actions/cache@v4 - with: - path: | - ~/.cache/rebar3/ - key: ${{matrix.otp}}-${{hashFiles('rebar.config')}} - - - name: Get compatible Rebar binaries - if: matrix.rebar == 'rebar3' && matrix.otp < 21 - run: rebar3 unlock eredis - - - name: Compile - run: | - ./autogen.sh - ./configure --with-rebar=./${{ matrix.rebar }} \ - --prefix=/tmp/ejabberd \ - --enable-all \ - --disable-elixir \ - --disable-tools \ - --disable-odbc - make - - - run: make xref - - - run: make dialyzer - - - name: Prepare rel (rebar2) - if: matrix.rebar == 'rebar' - run: | - mkdir -p _build/prod && ln -s `pwd`/rel/ _build/prod/rel - mkdir -p _build/dev && ln -s `pwd`/rel/ _build/dev/rel - - - name: Run rel - run: | - make rel - _build/prod/rel/ejabberd/bin/ejabberdctl start \ - && _build/prod/rel/ejabberd/bin/ejabberdctl started - _build/prod/rel/ejabberd/bin/ejabberdctl register user1 localhost s0mePass - _build/prod/rel/ejabberd/bin/ejabberdctl registered_users localhost > registered.log - _build/prod/rel/ejabberd/bin/ejabberdctl stop \ - && _build/prod/rel/ejabberd/bin/ejabberdctl stopped - - - name: Run dev - run: | - make dev - _build/dev/rel/ejabberd/bin/ejabberdctl start \ - && _build/dev/rel/ejabberd/bin/ejabberdctl started - _build/dev/rel/ejabberd/bin/ejabberdctl register user2 localhost s0mePass - _build/dev/rel/ejabberd/bin/ejabberdctl registered_users localhost >> registered.log - _build/dev/rel/ejabberd/bin/ejabberdctl stop \ - && _build/dev/rel/ejabberd/bin/ejabberdctl stopped - - - name: Run install - run: | - make install - /tmp/ejabberd/sbin/ejabberdctl start \ - && /tmp/ejabberd/sbin/ejabberdctl started - /tmp/ejabberd/sbin/ejabberdctl register user3 localhost s0mePass - /tmp/ejabberd/sbin/ejabberdctl registered_users localhost >> registered.log - /tmp/ejabberd/sbin/ejabberdctl stop \ - && /tmp/ejabberd/sbin/ejabberdctl stopped - - - name: View logs - run: | - echo "===> Registered:" - cat registered.log - echo "===> Prod:" - cat _build/prod/rel/ejabberd/logs/* - echo "===> Dev:" - cat _build/dev/rel/ejabberd/logs/* - echo "===> Install:" - cat /tmp/ejabberd/var/log/ejabberd/* - - - name: Check logs - run: | - grep -q '^user1$' registered.log - grep -q '^user2$' registered.log - grep -q '^user3$' registered.log - grep -q 'is started' _build/prod/rel/ejabberd/logs/ejabberd.log - grep -q 'is stopped' _build/prod/rel/ejabberd/logs/ejabberd.log - test $(find _build/prod/rel/ -empty -name error.log) - grep -q 'is started' _build/dev/rel/ejabberd/logs/ejabberd.log - grep -q 'is stopped' _build/dev/rel/ejabberd/logs/ejabberd.log - test $(find _build/dev/rel/ -empty -name error.log) - grep -q 'is started' /tmp/ejabberd/var/log/ejabberd/ejabberd.log - grep -q 'is stopped' /tmp/ejabberd/var/log/ejabberd/ejabberd.log - test $(find /tmp/ejabberd/var/log/ejabberd/ -empty -name error.log) - - - name: View logs failures - if: always() - run: | - cat _build/prod/rel/ejabberd/logs/ejabberd.log - cat _build/prod/rel/ejabberd/logs/error.log - cat _build/dev/rel/ejabberd/logs/ejabberd.log - cat _build/dev/rel/ejabberd/logs/error.log - cat /tmp/ejabberd/var/log/ejabberd/ejabberd.log - cat /tmp/ejabberd/var/log/ejabberd/error.log - - rebar3-elixir: - name: Rebar3+Elixir - strategy: - fail-fast: false - matrix: - elixir: ['1.13', '1.14', '1.15', '1.16', '1.17', '1.18'] - runs-on: ubuntu-24.04 - container: - image: elixir:${{ matrix.elixir }} - - steps: - - - uses: actions/checkout@v4 - - - 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: Enable Module.Example and an Elixir dependency - run: | - sed -i "s|^modules:|modules:\n 'Ejabberd.Module.Example': {}|g" ejabberd.yml.example - cat ejabberd.yml.example - sed -i 's|^{deps, \[\(.*\)|{deps, [{decimal, ".*", {git, "https://github.com/ericmj/decimal", {branch, "main"}}},\n \1|g' rebar.config - cat rebar.config - - - name: Cache Hex.pm - uses: actions/cache@v4 - with: - path: | - ~/.cache/rebar3/ - 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: | - ./autogen.sh - ./configure --with-rebar=./rebar3 \ - --prefix=/tmp/ejabberd \ - --enable-all \ - --disable-odbc - make - - - run: make xref - - - name: Run rel - run: | - make rel - _build/prod/rel/ejabberd/bin/ejabberdctl start \ - && _build/prod/rel/ejabberd/bin/ejabberdctl started - _build/prod/rel/ejabberd/bin/ejabberdctl register user1 localhost s0mePass - _build/prod/rel/ejabberd/bin/ejabberdctl registered_users localhost > registered.log - _build/prod/rel/ejabberd/bin/ejabberdctl stop \ - && _build/prod/rel/ejabberd/bin/ejabberdctl stopped - - - name: Run dev - run: | - make dev - _build/dev/rel/ejabberd/bin/ejabberdctl start \ - && _build/dev/rel/ejabberd/bin/ejabberdctl started - _build/dev/rel/ejabberd/bin/ejabberdctl register user2 localhost s0mePass - _build/dev/rel/ejabberd/bin/ejabberdctl registered_users localhost >> registered.log - _build/dev/rel/ejabberd/bin/ejabberdctl stop \ - && _build/dev/rel/ejabberd/bin/ejabberdctl stopped - - - name: Run install - run: | - make install - /tmp/ejabberd/sbin/ejabberdctl start \ - && /tmp/ejabberd/sbin/ejabberdctl started - /tmp/ejabberd/sbin/ejabberdctl register user3 localhost s0mePass - /tmp/ejabberd/sbin/ejabberdctl registered_users localhost >> registered.log - /tmp/ejabberd/sbin/ejabberdctl stop \ - && /tmp/ejabberd/sbin/ejabberdctl stopped - - - name: View logs - if: always() - run: | - echo "===> Registered:" - cat registered.log - echo "===> Prod:" - cat _build/prod/rel/ejabberd/logs/* - echo "===> Dev:" - cat _build/dev/rel/ejabberd/logs/* - echo "===> Install:" - cat /tmp/ejabberd/var/log/ejabberd/* - - - name: Check logs - if: always() - run: | - grep -q '^user1$' registered.log - grep -q '^user2$' registered.log - grep -q '^user3$' registered.log - grep -q 'is started' _build/prod/rel/ejabberd/logs/ejabberd.log - grep -q 'is stopped' _build/prod/rel/ejabberd/logs/ejabberd.log - grep -q 'Stopping Ejabberd.Module.Example' _build/prod/rel/ejabberd/logs/ejabberd.log - test $(find _build/prod/ -empty -name error.log) - grep -q 'is started' _build/dev/rel/ejabberd/logs/ejabberd.log - grep -q 'is stopped' _build/dev/rel/ejabberd/logs/ejabberd.log - grep -q 'Stopping Ejabberd.Module.Example' _build/dev/rel/ejabberd/logs/ejabberd.log - test $(find _build/dev/ -empty -name error.log) - grep -q 'is started' /tmp/ejabberd/var/log/ejabberd/ejabberd.log - grep -q 'is stopped' /tmp/ejabberd/var/log/ejabberd/ejabberd.log - grep -q 'Stopping Ejabberd.Module.Example' /tmp/ejabberd/var/log/ejabberd/ejabberd.log - test $(find /tmp/ejabberd/var/log/ejabberd/ -empty -name error.log) - - - name: View logs failures - if: failure() - run: | - cat _build/prod/rel/ejabberd/logs/ejabberd.log - cat _build/prod/rel/ejabberd/logs/error.log - cat _build/dev/rel/ejabberd/logs/ejabberd.log - cat _build/dev/rel/ejabberd/logs/error.log - cat /tmp/ejabberd/var/log/ejabberd/ejabberd.log - cat /tmp/ejabberd/var/log/ejabberd/error.log - - mix: - name: Mix - strategy: - fail-fast: false - matrix: - elixir: ['1.13', '1.14', '1.15', '1.16', '1.17', '1.18'] - runs-on: ubuntu-24.04 - container: - image: elixir:${{ matrix.elixir }} - - steps: - - - uses: actions/checkout@v4 - - - 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: Remove Elixir Matchers - run: | - echo "::remove-matcher owner=elixir-mixCompileWarning::" - echo "::remove-matcher owner=elixir-credoOutputDefault::" - echo "::remove-matcher owner=elixir-mixCompileError::" - echo "::remove-matcher owner=elixir-mixTestFailure::" - echo "::remove-matcher owner=elixir-dialyzerOutputDefault::" - - - name: Enable Module.Example and an Elixir dependency - run: | - sed -i "s|^modules:|modules:\n 'Ejabberd.Module.Example': {}|g" ejabberd.yml.example - cat ejabberd.yml.example - sed -i 's|^{deps, \(.*\)|{deps, \1\n {decimal, ".*", {git, "https://github.com/ericmj/decimal", {branch, "main"}}}, |g' rebar.config - cat rebar.config - - - name: Cache Hex.pm - uses: actions/cache@v4 - with: - path: | - ~/.hex/ - 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: | - ./autogen.sh - ./configure --with-rebar=mix \ - --prefix=/tmp/ejabberd \ - --enable-all - make - - - run: make xref - - - run: make dialyzer - - - run: make edoc - if: matrix.elixir >= '1.14' - - - name: Run rel - run: | - make rel - _build/prod/rel/ejabberd/bin/ejabberdctl start \ - && _build/prod/rel/ejabberd/bin/ejabberdctl started - _build/prod/rel/ejabberd/bin/ejabberdctl register user1 localhost s0mePass - _build/prod/rel/ejabberd/bin/ejabberdctl registered_users localhost > registered.log - _build/prod/rel/ejabberd/bin/ejabberdctl stop \ - && _build/prod/rel/ejabberd/bin/ejabberdctl stopped - - - name: Run dev - run: | - make dev - _build/dev/rel/ejabberd/bin/ejabberdctl start \ - && _build/dev/rel/ejabberd/bin/ejabberdctl started - _build/dev/rel/ejabberd/bin/ejabberdctl register user2 localhost s0mePass - _build/dev/rel/ejabberd/bin/ejabberdctl registered_users localhost >> registered.log - _build/dev/rel/ejabberd/bin/ejabberdctl stop \ - && _build/dev/rel/ejabberd/bin/ejabberdctl stopped - - - name: Run install - run: | - make install - /tmp/ejabberd/sbin/ejabberdctl start \ - && /tmp/ejabberd/sbin/ejabberdctl started - /tmp/ejabberd/sbin/ejabberdctl register user3 localhost s0mePass - /tmp/ejabberd/sbin/ejabberdctl registered_users localhost >> registered.log - /tmp/ejabberd/sbin/ejabberdctl stop \ - && /tmp/ejabberd/sbin/ejabberdctl stopped - - - name: View logs - if: always() - run: | - echo "===> Registered:" - cat registered.log - echo "===> Prod:" - cat _build/prod/rel/ejabberd/logs/* - echo "===> Dev:" - cat _build/dev/rel/ejabberd/logs/* - echo "===> Install:" - cat /tmp/ejabberd/var/log/ejabberd/* - - - name: Check logs - if: always() - run: | - grep -q '^user1$' registered.log - grep -q '^user2$' registered.log - grep -q '^user3$' registered.log - grep -q 'is started' _build/prod/rel/ejabberd/logs/ejabberd.log - grep -q 'is stopped' _build/prod/rel/ejabberd/logs/ejabberd.log - grep -q 'Stopping Ejabberd.Module.Example' _build/prod/rel/ejabberd/logs/ejabberd.log - test $(find _build/prod/ -empty -name error.log) - grep -q 'is started' _build/dev/rel/ejabberd/logs/ejabberd.log - grep -q 'is stopped' _build/dev/rel/ejabberd/logs/ejabberd.log - grep -q 'Stopping Ejabberd.Module.Example' _build/dev/rel/ejabberd/logs/ejabberd.log - test $(find _build/dev/ -empty -name error.log) - grep -q 'is started' /tmp/ejabberd/var/log/ejabberd/ejabberd.log - grep -q 'is stopped' /tmp/ejabberd/var/log/ejabberd/ejabberd.log - grep -q 'Stopping Ejabberd.Module.Example' /tmp/ejabberd/var/log/ejabberd/ejabberd.log - test $(find /tmp/ejabberd/var/log/ejabberd/ -empty -name error.log) - - - name: View logs failures - if: failure() - run: | - cat _build/prod/rel/ejabberd/logs/ejabberd.log - cat _build/prod/rel/ejabberd/logs/error.log - cat _build/dev/rel/ejabberd/logs/ejabberd.log - cat _build/dev/rel/ejabberd/logs/error.log - cat /tmp/ejabberd/var/log/ejabberd/ejabberd.log - cat /tmp/ejabberd/var/log/ejabberd/error.log