Debian Codegraph @

.github/workflows/legacy-platforms-ci.yml

raw symbols SCIP
1 name: Legacy Platforms CI
2
3 on:
4 push:
5 branches:
6 - master
7 - 1.3.9
8 paths-ignore:
9 - NEWS
10 - RELEASE_NOTES
11 - 'doc/**'
12 - '**/*.html'
13 - '**/*.md'
14 pull_request:
15 branches:
16 - master
17 - 1.3.9
18 paths-ignore:
19 - NEWS
20 - RELEASE_NOTES
21 - 'doc/**'
22 - '**/*.html'
23 - '**/*.md'
24
25 jobs:
26 build:
27 runs-on: ubuntu-latest
28
29 services:
30 memcached:
31 # Docker Hub image
32 image: memcached:1.6-alpine
33 # Set health checks to wait until memcached has started
34 options: >-
35 --health-cmd "echo 'version' | nc -vn -w 1 127.0.0.1 11211"
36 --health-interval 10s
37 --health-timeout 5s
38 --health-retries 5
39
40 redis:
41 # Docker Hub image
42 image: redis:6-alpine
43 # Set health checks to wait until redis has started
44 options: >-
45 --health-cmd "redis-cli ping"
46 --health-interval 10s
47 --health-timeout 5s
48 --health-retries 5
49
50 environment: CI
51
52 env:
53 # GitHub runners still causing problems with NodeJS v20; see:
54 # https://github.com/actions/checkout/issues/1809.
55 ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
56
57 PACKAGE_VERSION: 1.3.9d
58 MEMCACHED_HOST: memcached
59 REDIS_HOST: redis
60
61 strategy:
62 matrix:
63 compiler:
64 - clang
65 - gcc
66 # We start with the containers whose glibc versions are too old for
67 # the NodeJS version mandated by the GitHub `checkout` action.
68 container:
69 - ubuntu:18.04
70
71 container: ${{ matrix.container }}
72
73 steps:
74 - name: Checkout source code
75 env:
76 DEBIAN_FRONTEND: noninteractive
77 TZ: UTC
78 run: |
79 apt-get update -qq
80 apt-get install -y git
81 git clone --depth 5 https://github.com/proftpd/proftpd.git
82 cd proftpd && pwd
83
84 - name: Whitespace check
85 if: ${{ matrix.container == 'ubuntu:18.04' }}
86 env:
87 DEBIAN_FRONTEND: noninteractive
88 TZ: UTC
89 run: |
90 apt-get update -qq
91 apt-get install -y git
92 cd proftpd && pwd
93 if ! git diff --no-color --check HEAD^ > /dev/null; then
94 echo "You must remove whitespace before submitting a pull request"
95 echo ""
96 git diff --check HEAD^
97 exit 1
98 fi
99
100 - name: Install Ubuntu 18.04 packages
101 if: ${{ matrix.container == 'ubuntu:18.04' }}
102 env:
103 DEBIAN_FRONTEND: noninteractive
104 TZ: UTC
105 run: |
106 # Need to add other repos for e.g. libsodium
107 apt-get update -qq
108 # for builds
109 apt-get install -y clang gcc git make
110 # for unit tests
111 apt-get install -y check libsubunit-dev
112 # for mod_lang
113 apt-get install -y gettext locales-all
114 # for xattr support
115 apt-get install -y libattr1-dev
116 # for mod_cap
117 apt-get install -y libcap-dev
118 # for mod_facl
119 apt-get install -y libacl1-dev
120 # for mod_geoip
121 apt-get install -y libgeoip-dev
122 # for mod_ldap
123 apt-get install -y libldap2-dev libsasl2-dev
124 # for mod_ldap runtime support for SCRAM
125 apt-get install -y libsasl2-modules-gssapi-mit
126 # for mod_rewrite
127 apt-get install -y libidn2-dev
128 # for memcache support
129 apt-get install -y libmemcached-dev
130 # for redis support
131 apt-get install -y libhiredis-dev
132 # for mod_sql_mysql
133 apt-get install -y libmysqlclient-dev
134 # for PAM support
135 apt-get install -y libpam-dev
136 # for mod_sql_postgres
137 apt-get install -y libpq-dev
138 # for mod_sql_odbc
139 apt-get install -y unixodbc-dev
140 # for OpenSSL support
141 apt-get install -y libssl-dev
142 # for Sodium support
143 apt-get install -y --force-yes libsodium-dev
144 # for mod_sql_sqlite
145 apt-get install -y libsqlite3-dev sqlite3
146 # for mod_wrap
147 apt-get install -y libwrap0-dev
148 # for PCRE2 support
149 apt-get install -y libpcre2-dev libpcre2-posix0
150 # for ftptop
151 apt-get install -y ncurses-dev
152 # for zlib support
153 apt-get install -y zlib1g-dev
154
155 # for logging
156 apt-get install -y rsyslog
157 service rsyslog start
158
159 # for static code analysis
160 # - sudo apt-get install -y cppcheck
161 # - sudo apt-get install rats
162 # for integration/regression test
163 # for test code coverage
164 apt-get install -y lcov ruby
165 gem install coveralls-lcov
166
167 # for HTML validation
168 apt-get install -y tidy
169
170 # The modules to build are distro-specific
171 echo "PROFTPD_MODULES=mod_sql:mod_sql_mysql:mod_sql_odbc:mod_sql_postgres:mod_sql_sqlite:mod_sql_passwd:mod_sftp:mod_sftp_sql:mod_sftp_pam:mod_tls:mod_tls_fscache:mod_tls_shmcache:mod_tls_memcache:mod_tls_redis:mod_ban:mod_copy:mod_ctrls_admin:mod_deflate:mod_dnsbl:mod_dynmasq:mod_exec:mod_facl:mod_geoip:mod_ifversion:mod_ldap:mod_load:mod_log_forensic:mod_qos:mod_quotatab:mod_quotatab_file:mod_quotatab_ldap:mod_quotatab_radius:mod_quotatab_sql:mod_radius:mod_readme:mod_rewrite:mod_shaper:mod_site_misc:mod_snmp:mod_wrap:mod_wrap2:mod_wrap2_file:mod_wrap2_redis:mod_wrap2_sql:mod_digest:mod_auth_otp:mod_statcache:mod_unique_id:mod_ifsession" >> $GITHUB_ENV
172
173 # for debugging
174 clang --version
175 gcc --version
176 lcov --version
177 openssl version -a
178
179 - name: Prepare code coverage
180 if: ${{ matrix.container == 'ubuntu:18.04' }}
181 run: |
182 cd proftpd && pwd
183 lcov --directory . --zerocounters
184
185 - name: Build with static modules
186 env:
187 CC: ${{ matrix.compiler }}
188 if: ${{ matrix.container == 'ubuntu:18.04' }}
189 run: |
190 cd proftpd && pwd
191 ./configure LIBS="-lodbc -lm -lsubunit -lrt -pthread" --enable-devel=coverage:fortify --enable-ctrls --enable-facl --enable-memcache --enable-nls --enable-pcre2 --enable-redis --enable-tests --with-modules="${{ env.PROFTPD_MODULES }}"
192 make
193
194 - name: Run unit tests
195 env:
196 CC: ${{ matrix.compiler }}
197 # Note: Skip the unit tests when using clang.
198 if: ${{ matrix.compiler == 'gcc' && matrix.container == 'ubuntu:18.04' }}
199 run: |
200 cd proftpd && pwd
201 make TEST_VERBOSE=1 check-api
202
203 - name: Upload code coverage
204 env:
205 COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
206 if: ${{ matrix.compiler == 'gcc' && matrix.container == 'ubuntu:18.04' }}
207 run: |
208 cd proftpd && pwd
209 lcov --ignore-errors gcov,source --directory . --capture --output-file all.info
210 # filter out system and test code
211 lcov --output-file coverage.info --remove all.info '*/lib/glibc-glob.c' '*/lib/ccan-json.c' '*/lib/hanson-tpl.*' '*/lib/openbsd-*' '*/lib/pr_fnmatch*'
212 # debug before upload
213 lcov --list coverage.info
214 # upload coverage info to coveralls
215 coveralls-lcov --repo-token="$COVERALLS_REPO_TOKEN" --service-name=github --service-job-id="$GITHUB_RUN_ID" --branch="$GITHUB_REF" coverage.info
216
217 - name: Install with static modules
218 env:
219 CC: ${{ matrix.compiler }}
220 if: ${{ matrix.container == 'ubuntu:18.04' }}
221 run: |
222 cd proftpd && pwd
223 make clean
224 ./configure LIBS="-lodbc" --enable-ctrls --enable-facl --enable-memcache --enable-nls --enable-pcre2 --enable-redis --with-modules="${{ env.PROFTPD_MODULES }}"
225 make
226 make install
227
228 - name: Run restart tests
229 env:
230 CC: ${{ matrix.compiler }}
231 PROFTPD_TEST_BIN: /usr/local/sbin/proftpd
232 PROFTPD_TEST_PIDFILE: /usr/local/var/proftpd.pid
233 # Note that the default config assumes user 'nobody', group 'nogroup',
234 # which do not exist in the default images of all distributions.
235 if: ${{ matrix.container == 'ubuntu:18.04' }}
236 run: |
237 test -e $PROFTPD_TEST_BIN
238 $PROFTPD_TEST_BIN
239 kill -0 $(cat $PROFTPD_TEST_PIDFILE)
240 kill -HUP $(cat $PROFTPD_TEST_PIDFILE)
241
242 kill -0 $(cat $PROFTPD_TEST_PIDFILE)
243 kill -HUP $(cat $PROFTPD_TEST_PIDFILE)
244
245 kill -0 $(cat $PROFTPD_TEST_PIDFILE)
246 kill -HUP $(cat $PROFTPD_TEST_PIDFILE)
247
248 kill -0 $(cat $PROFTPD_TEST_PIDFILE)
249 kill -TERM $(cat $PROFTPD_TEST_PIDFILE)
250
251 # Given the daemon a chance to clean up
252 sleep 1
253 ! test -f $PROFTPD_TEST_PIDFILE
254
255 - name: Build with shared modules
256 env:
257 CC: ${{ matrix.compiler }}
258 if: ${{ matrix.container == 'ubuntu:18.04' }}
259 run: |
260 cd proftpd && pwd
261 make clean
262 ./configure LIBS="-lodbc -lm -lsubunit -lrt -pthread" --enable-devel=fortify --enable-ctrls --enable-dso --enable-facl --enable-memcache --enable-nls --enable-pcre2 --enable-tests --with-shared="${{ env.PROFTPD_MODULES }}"
263 make
264
265 - name: Install with shared modules
266 run: |
267 cd proftpd && pwd
268 make install
269
270 # https://github.com/google/sanitizers/wiki/AddressSanitizer
271 # https://github.com/google/sanitizers/wiki/AddressSanitizerLeakSanitizer
272 # https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html
273 #
274 # NOTE: Using MemorySanitizer is desirable, but currently unusable since
275 # libcheck is not instrumented, resulting in unsuppressible false
276 # positives.
277 #
278 # NOTE: Currently, libmemcached is shown to leak memory via realloc(3)
279 # by ASAN, so we deliberately do NOT enable memcache support for this.
280 # Sadly.
281 - name: Run unit tests under asan+lsan+ubsan
282 env:
283 ASAN_OPTIONS: abort_on_error=1,check_initialization_order=true,debug=true,detect_invalid_pointer_pairs=2,detect_leaks=1,detect_stack_use_after_return=true,strict_string_checks=true,verbosity=0
284 CC: ${{ matrix.compiler }}
285 CFLAGS: -fsanitize=address,undefined -DPR_DEVEL_NO_POOL_FREELIST
286 LDFLAGS: -fsanitize=address,undefined
287 if: ${{ matrix.compiler == 'clang' && matrix.container == 'ubuntu:18.04' }}
288 run: |
289 cd proftpd && pwd
290 make clean
291 ./configure LIBS="-lm -lsubunit -lrt -pthread" --enable-devel --enable-ctrls --enable-facl --enable-nls --enable-pcre2 --enable-redis --enable-tests
292 make
293 export ASAN_SYMBOLIZER_PATH=$(readlink -f $(which llvm-symbolizer-10))
294 make check-api