Skip to content

Commit cd69c63

Browse files
pks-tgitster
authored andcommitted
ci: add job performing static analysis on GitLab CI
Our GitHub Workflows definitions have a static analysis job that runs the following tasks: - Coccinelle to check for suggested refactorings. - `make hdr-check` to check for missing includes or forward declarations in our header files. - `make check-pot` to check our translations for issues. - `./ci/check-directional-formatting.bash` to check whether our sources contain any Unicode directional formatting code points. Add an equivalent job to our GitLab CI definitions. Signed-off-by: Patrick Steinhardt <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent a26002b commit cd69c63

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

.gitlab-ci.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,13 @@ test:
5151
paths:
5252
- t/failed-test-artifacts
5353
when: on_failure
54+
55+
static-analysis:
56+
image: ubuntu:22.04
57+
variables:
58+
jobname: StaticAnalysis
59+
before_script:
60+
- ./ci/install-docker-dependencies.sh
61+
script:
62+
- ./ci/run-static-analysis.sh
63+
- ./ci/check-directional-formatting.bash

ci/install-docker-dependencies.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ linux-musl)
2121
apache2 apache2-http2 apache2-proxy apache2-ssl apache2-webdav apr-util-dbd_sqlite3 \
2222
bash cvs gnupg perl-cgi perl-dbd-sqlite >/dev/null
2323
;;
24-
linux-*)
24+
linux-*|StaticAnalysis)
2525
# Required so that apt doesn't wait for user input on certain packages.
2626
export DEBIAN_FRONTEND=noninteractive
2727

@@ -31,6 +31,11 @@ linux-*)
3131
perl-modules liberror-perl libauthen-sasl-perl libemail-valid-perl \
3232
libdbd-sqlite3-perl libio-socket-ssl-perl libnet-smtp-ssl-perl ${CC_PACKAGE:-${CC:-gcc}} \
3333
apache2 cvs cvsps gnupg libcgi-pm-perl subversion
34+
35+
if test "$jobname" = StaticAnalysis
36+
then
37+
apt install -q -y coccinelle
38+
fi
3439
;;
3540
pedantic)
3641
dnf -yq update >/dev/null &&

0 commit comments

Comments
 (0)