-
Notifications
You must be signed in to change notification settings - Fork 140
168 lines (142 loc) · 4.96 KB
/
ci.yml
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
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', '26']
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 '{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}' >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, \[fusco, observer_cli, recon, \
{cuesport, ".*", {git, "https://github.com/goj/cuesport"}}, \
{ecaptcha, ".*", {git, "https://github.com/seriyps/ecaptcha", {branch, "master"}}}, \
|g' rebar.config
sed -i 's|stdlib, |stdlib, fusco, observer_cli, recon, cuesport, ecaptcha, |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