forked from processone/ejabberd
-
Notifications
You must be signed in to change notification settings - Fork 0
206 lines (182 loc) · 6.32 KB
/
runtime.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
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
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: ['19.3', '20.3', '24.3', '25']
rebar: ['rebar', 'rebar3']
runs-on: ubuntu-latest
container:
image: erlang:${{ matrix.otp }}
steps:
- uses: actions/checkout@v3
- name: Prepare libraries
run: |
apt-get -qq update
apt-get purge -y libgd3
apt-get -qq install libexpat1-dev libgd-dev libpam0g-dev \
libsqlite3-dev libwebp-dev libyaml-dev
- name: Compile
run: |
./autogen.sh
./configure --with-rebar=`which ${{ matrix.rebar }}` \
--prefix=/tmp/ejabberd \
--enable-all \
--disable-elixir \
--disable-odbc
make update
make
- name: Prepare rebar
run: |
echo '{xref_ignores, [{eldap_filter_yecc, return_error, 2}
]}.' >>rebar.config
echo '{xref_checks, [deprecated_function_calls, deprecated_functions,
locals_not_used, undefined_function_calls, undefined_functions]}.
% Disabled: exports_not_used,' >>rebar.config
- run: make xref
- name: Test rel (rebar2)
if: matrix.rebar == 'rebar'
run: |
make rel
rel/ejabberd/bin/ejabberdctl start \
&& rel/ejabberd/bin/ejabberdctl started
rel/ejabberd/bin/ejabberdctl register user1 localhost s0mePass
rel/ejabberd/bin/ejabberdctl registered_users localhost
cat rel/ejabberd/logs/*
- name: Test rel
if: matrix.rebar != 'rebar'
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
_build/prod/rel/ejabberd/bin/ejabberdctl stop \
&& _build/prod/rel/ejabberd/bin/ejabberdctl stopped
cat _build/prod/rel/ejabberd/logs/*
- name: Test dev
if: matrix.rebar != 'rebar'
run: |
make dev
_build/dev/rel/ejabberd/bin/ejabberdctl start \
&& _build/dev/rel/ejabberd/bin/ejabberdctl started
_build/dev/rel/ejabberd/bin/ejabberdctl register user1 localhost s0mePass
_build/dev/rel/ejabberd/bin/ejabberdctl registered_users localhost
_build/dev/rel/ejabberd/bin/ejabberdctl stop \
&& _build/dev/rel/ejabberd/bin/ejabberdctl stopped
cat _build/dev/rel/ejabberd/logs/*
mix:
name: Mix
strategy:
fail-fast: false
matrix:
otp: ['21.3', '22.0', '25.0']
elixir: ['1.10.3', '1.11.4', '1.12.3', '1.13.0', '1.14.0']
exclude:
- otp: '21.3'
elixir: '1.12.3'
- otp: '21.3'
elixir: '1.13.0'
- otp: '21.3'
elixir: '1.14.0'
- otp: '22.0'
elixir: '1.14.0'
- otp: '25.0'
elixir: '1.10.3'
- otp: '25.0'
elixir: '1.11.4'
- otp: '25.0'
elixir: '1.12.3'
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Get specific Erlang/OTP
uses: erlef/setup-beam@v1
with:
otp-version: ${{matrix.otp}}
elixir-version: ${{matrix.elixir}}
- 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 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: Compile
run: |
./autogen.sh
./configure --with-rebar=mix \
--prefix=/tmp/ejabberd \
--enable-all \
--disable-elixir \
--disable-odbc
mix deps.get
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: Check rel
if: always()
run: |
grep -q '^user1$' registered.log
grep -q '^user2$' 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/ -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/ -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