1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180
|
name: Weekly
on:
schedule:
- cron: '30 9 * * 0'
jobs:
############################################################### Compile #####
test:
runs-on: ubuntu-24.04-arm
strategy:
matrix:
otp: ['25', '26', '27', '28']
steps:
- uses: actions/checkout@v6
- uses: erlef/setup-beam@v1
with:
otp-version: ${{ matrix.otp }}
hexpm-mirrors: |
https://cdn.jsdelivr.net/hex
https://builds.hex.pm
- uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: libexpat1-dev libgd-dev libpam0g-dev
libsqlite3-dev libwebp-dev libyaml-dev
- name: Compile
uses: ./.github/actions/manage-ejabberd
with:
for: prod
do: compile
tool: rebar3
configure: --disable-elixir --disable-mssql
########################################################## Static Tests #####
- name: Test shell scripts
run: |
shellcheck ejabberd.init.template
shellcheck -x ejabberdctl.template
shellcheck .vscode/relive.sh
shellcheck rel/setup-dev.sh
shellcheck rel/setup-relive.sh
shellcheck test/ejabberd_SUITE_data/gencerts.sh
shellcheck tools/captcha.sh
shellcheck tools/emacs-indent.sh
shellcheck tools/generate-doap.sh
shellcheck tools/prepare-tr.sh
shellcheck tools/rebar3-format.sh
- run: make hooks
- run: make options
- run: make xref
- run: make dialyzer
- run: make test-eunit
- run: make elvis
if: matrix.otp > '25'
- run: make install -s
######################################################### Dynamic Tests #####
- name: Check production release
uses: ./.github/actions/manage-ejabberd
with:
for: prod
do: deploy, start, stop, check
- name: Start development release
uses: ./.github/actions/manage-ejabberd
with:
for: dev
do: deploy, no_tls, start, register
username: user123
- name: Stop development release
if: always()
uses: ./.github/actions/manage-ejabberd
with:
for: dev
do: stop, check
- name: View production logs
if: always()
uses: ./.github/actions/manage-ejabberd
with:
for: prod
do: logs
- name: View development logs
if: always()
uses: ./.github/actions/manage-ejabberd
with:
for: dev
do: logs
##################################################### Common Test Suite #####
- name: Prepare database
uses: ./.github/actions/manage-database
with:
for: mysql, pgsql, redis
do: install, start, user, create
- name: Setup multihost SQL schema
run: |
sed -i 's|new_schema, false|new_schema, true|g' test/suite.erl
- name: Run tests
id: ct
run: make test
- name: Send to coveralls
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
DIAGNOSTIC=1 ./rebar3 as test coveralls send
- name: Check results
if: always() && (steps.ct.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
if: always()
run: |
echo "::group::ejabberd.log"
find logs/ -name ejabberd.log -exec cat '{}' ';'
echo "::endgroup::"
echo "::group::error.log"
find logs/ -name error.log -exec cat '{}' ';'
echo "::endgroup::"
echo "::group::exunit.log"
find logs/ -name exunit.log -exec cat '{}' ';'
echo "::endgroup::"
echo "::group::suite.log (only failures)"
cat logs/suite.log | awk \
'BEGIN{RS="\n=case";FS="\n"} /=result\s*failed/ {print "=case" $0}'
echo "::endgroup::"
echo "::group::suite.log (complete)"
cat logs/suite.log
echo "::endgroup::"
- name: Upload CT logs
if: failure()
uses: actions/upload-artifact@v6
with:
name: ct-logs-${{ matrix.otp }}
path: _build/test/logs
retention-days: 14
############################################################# Coveralls #####
cover:
needs: test
if: always()
runs-on: ubuntu-24.04-arm
steps:
- name: Finish parallel upload to coveralls
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
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"}}'
|