From: Taylor Blau <me@ttaylorr.com>
To: git@vger.kernel.org
Cc: Junio C Hamano <gitster@pobox.com>, Jeff King <peff@peff.net>
Subject: [PATCH] .github/workflows: add coverity action
Date: Mon, 21 Aug 2023 23:34:32 -0400 [thread overview]
Message-ID: <4590e1381feb8962cadf2b40b22086531d662ef8.1692675172.git.me@ttaylorr.com> (raw)
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 accepts "builds" (which is more or
less the collection of '*.o' files generated during a standard build
with "make") as input and generates reports as output. In order to
generate a report, we have to first compile Git and then upload the
build archive to Coverity.
This Action generates and uploads a build archive to Coverity when a
GitHub repository has configured the "COVERITY_SCAN_EMAIL" and
"COVERITY_SCAN_TOKEN" repository secrets, respectively. This enables
Coverity to automatically report on new changes pushed to 'master', as
well as any newly created tags.
A couple of implementation notes:
- In order to successfully build 'git', we (ab-)use the
ci/install-dependencies.sh script by faking in some of the
environment variables to take on values specific to the main.yml
workflow file in order to install the correct set of dependencies.
- We could upload the build archive to Coverity directly with a
straightforward curl request. But using the vapier/coverity-scan
Action comes with some additional niceties, such as caching the
(rather large) Coverity tool download between runs.
If the repository is missing either of the two secret tokens mentioned
earlier, this Action is a no-op.
Signed-off-by: Taylor Blau <me@ttaylorr.com>
---
.github/workflows/coverity.yml | 35 ++++++++++++++++++++++++++++++++++
1 file changed, 35 insertions(+)
create mode 100644 .github/workflows/coverity.yml
diff --git a/.github/workflows/coverity.yml b/.github/workflows/coverity.yml
new file mode 100644
index 0000000000..26b9145d9e
--- /dev/null
+++ b/.github/workflows/coverity.yml
@@ -0,0 +1,35 @@
+name: Coverity
+
+on:
+ push:
+ branches:
+ - master
+ tags:
+ - '*'
+
+jobs:
+ coverity:
+ runs-on: ubuntu-latest
+ env:
+ HAVE_COVERITY_TOKEN: ${{ secrets.COVERITY_SCAN_EMAIL != '' && secrets.COVERITY_SCAN_TOKEN != '' }}
+ steps:
+ - id: check-coverity
+ name: check whether Coverity token is configured
+ run: |
+ echo "enabled=$HAVE_COVERITY_TOKEN" >>$GITHUB_OUTPUT
+ - uses: actions/checkout@v3
+ if: steps.check-coverity.outputs.enabled == 'true'
+ - run: ci/install-dependencies.sh
+ env:
+ CC: gcc
+ CC_PACKAGE: gcc-9
+ jobname: linux-gcc-default
+ runs_on_pool: ubuntu-latest
+ if: steps.check-coverity.outputs.enabled == 'true'
+ - uses: vapier/coverity-scan-action@v1
+ if: steps.check-coverity.outputs.enabled == 'true'
+ with:
+ email: ${{ secrets.COVERITY_SCAN_EMAIL }}
+ token: ${{ secrets.COVERITY_SCAN_TOKEN }}
+ command: make -j8
+
--
2.42.0.15.geed1e1a32a
next reply other threads:[~2023-08-22 3:34 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-22 3:34 Taylor Blau [this message]
2023-08-25 21:32 ` [PATCH] .github/workflows: add coverity action Jeff King
2023-08-25 21:56 ` Jeff King
2023-08-29 8:18 ` Johannes Schindelin
2023-08-30 0:18 ` Jeff King
2023-08-30 8:07 ` Johannes Schindelin
2023-08-30 19:03 ` Jeff King
2023-09-21 21:53 ` [PATCH v2] " Taylor Blau
2023-09-21 23:30 ` Junio C Hamano
2023-09-22 11:09 ` Johannes Schindelin
2023-09-23 6:21 ` Jeff King
2023-09-23 7:09 ` Jeff King
2023-09-23 6:10 ` Jeff King
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4590e1381feb8962cadf2b40b22086531d662ef8.1692675172.git.me@ttaylorr.com \
--to=me@ttaylorr.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=peff@peff.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).