]> git.ipfire.org Git - thirdparty/git.git/commit
ci: add a GitHub workflow to submit Coverity scans
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Mon, 25 Sep 2023 11:50:57 +0000 (11:50 +0000)
committerJunio C Hamano <gitster@pobox.com>
Mon, 25 Sep 2023 17:12:48 +0000 (10:12 -0700)
commita56b6230d0b1901c01e355320c7afdbf5a6ae01b
tree07a9efe837bf75cce3f885d78e39189b4daebb33
parent43c8a30d150ecede9709c1f2527c8fba92c65f40
ci: add a GitHub workflow to submit Coverity scans

Coverity is a static analysis tool that detects and generates reports on
various security and code quality issues.

It is particularly useful when diagnosing memory safety issues which may
be used as part of exploiting a security vulnerability.

Coverity's website provides a service that accepts "builds" (which
contains the object files generated during a standard build as well as a
database generated by Coverity's scan tool).

Let's add a GitHub workflow to automate all of this. To avoid running it
without appropriate Coverity configuration (e.g. the token required to
use Coverity's services), the job only runs when the repository variable
"ENABLE_COVERITY_SCAN_FOR_BRANCHES" has been configured accordingly (see
https://docs.github.com/en/actions/learn-github-actions/variables for
details how to configure repository variables): It is expected to be a
valid JSON array of branch strings, e.g. `["main", "next"]`.

In addition, this workflow requires two repository secrets:

- COVERITY_SCAN_EMAIL: the email to send the report to, and

- COVERITY_SCAN_TOKEN: the Coverity token (look in the Project Settings
  tab of your Coverity project).

Note: The initial version of this patch used
`vapier/coverity-scan-action` to benefit from that Action's caching of
the Coverity tool, which is rather large. Sadly, that Action only
supports Linux, and we want to have the option of building on Windows,
too. Besides, in the meantime Coverity requires `cov-configure` to be
runantime, and that Action was not adjusted accordingly, i.e. it seems
not to be maintained actively. Therefore it would seem prudent to
implement the steps manually instead of using that Action.

Initial-patch-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
.github/workflows/coverity.yml [new file with mode: 0644]