git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Johannes Schindelin via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: Johannes Schindelin <johannes.schindelin@gmx.de>,
	Johannes Schindelin <johannes.schindelin@gmx.de>
Subject: [PATCH 5/6] coverity: allow running on macOS
Date: Fri, 22 Sep 2023 10:42:02 +0000	[thread overview]
Message-ID: <782cf2b440313fcad0492ee352fa66d1a3534ac4.1695379323.git.gitgitgadget@gmail.com> (raw)
In-Reply-To: <pull.1588.git.1695379323.gitgitgadget@gmail.com>

From: Johannes Schindelin <johannes.schindelin@gmx.de>

For completeness' sake, let's add support for submitting macOS builds to
Coverity Scan.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 .github/workflows/coverity.yml | 22 ++++++++++++++++++++--
 1 file changed, 20 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/coverity.yml b/.github/workflows/coverity.yml
index 70ba3f97c18..ca51048ed9d 100644
--- a/.github/workflows/coverity.yml
+++ b/.github/workflows/coverity.yml
@@ -42,7 +42,7 @@ jobs:
         if: contains(matrix.os, 'windows')
         uses: git-for-windows/setup-git-for-windows-sdk@v1
       - run: ci/install-dependencies.sh
-        if: contains(matrix.os, 'ubuntu')
+        if: contains(matrix.os, 'ubuntu') || contains(matrix.os, 'macos')
         env:
           runs_on_pool: ${{ matrix.os }}
 
@@ -55,10 +55,17 @@ jobs:
           *windows*)
             COVERITY_PLATFORM=win64
             COVERITY_TOOL_FILENAME=cov-analysis.zip
+            MAKEFLAGS=-j$(nproc)
+            ;;
+          *macos*)
+            COVERITY_PLATFORM=macOSX
+            COVERITY_TOOL_FILENAME=cov-analysis.dmg
+            MAKEFLAGS=-j$(sysctl -n hw.physicalcpu)
             ;;
           *ubuntu*)
             COVERITY_PLATFORM=linux64
             COVERITY_TOOL_FILENAME=cov-analysis.tgz
+            MAKEFLAGS=-j$(nproc)
             ;;
           *)
             echo '::error::unhandled OS ${{ matrix.os }}' >&2
@@ -67,6 +74,7 @@ jobs:
           esac
           echo "COVERITY_PLATFORM=$COVERITY_PLATFORM" >>$GITHUB_ENV
           echo "COVERITY_TOOL_FILENAME=$COVERITY_TOOL_FILENAME" >>$GITHUB_ENV
+          echo "MAKEFLAGS=$MAKEFLAGS" >>$GITHUB_ENV
           MD5=$(curl https://scan.coverity.com/download/$COVERITY_LANGUAGE/$COVERITY_PLATFORM \
                    --data "token=${{ secrets.COVERITY_SCAN_TOKEN }}&project=$COVERITY_PROJECT&md5=1")
           echo "hash=$MD5" >>$GITHUB_OUTPUT
@@ -94,6 +102,16 @@ jobs:
             mkdir $RUNNER_TEMP/cov-analysis &&
             tar -xzf $RUNNER_TEMP/$COVERITY_TOOL_FILENAME --strip 1 -C $RUNNER_TEMP/cov-analysis
             ;;
+          *.dmg)
+            cd $RUNNER_TEMP &&
+            attach="$(hdiutil attach $COVERITY_TOOL_FILENAME)" &&
+            volume="$(echo "$attach" | cut -f 3 | grep /Volumes/)" &&
+            mkdir cov-analysis &&
+            cd cov-analysis &&
+            sh "$volume"/cov-analysis-macosx-*.sh &&
+            ls -l &&
+            hdiutil detach "$volume"
+            ;;
           *.zip)
             cd $RUNNER_TEMP &&
             mkdir cov-analysis-tmp &&
@@ -115,7 +133,7 @@ jobs:
         run: |
           export PATH="$RUNNER_TEMP/cov-analysis/bin:$PATH" &&
           cov-configure --gcc &&
-          cov-build --dir cov-int make -j$(nproc)
+          cov-build --dir cov-int make
       - name: package the build
         run: tar -czvf cov-int.tgz cov-int
       - name: submit the build to Coverity Scan
-- 
gitgitgadget


  parent reply	other threads:[~2023-09-22 10:42 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-22 10:41 [PATCH 0/6] Add a GitHub workflow to submit builds to Coverity Scan Johannes Schindelin via GitGitGadget
2023-09-22 10:41 ` [PATCH 1/6] ci: add a GitHub workflow to submit Coverity scans Johannes Schindelin via GitGitGadget
2023-09-23  6:49   ` Jeff King
2023-09-25 11:52     ` Johannes Schindelin
2023-09-25 12:09       ` Jeff King
2023-09-22 10:41 ` [PATCH 2/6] coverity: cache the Coverity Build Tool Johannes Schindelin via GitGitGadget
2023-09-23  6:58   ` Jeff King
2023-09-25 11:52     ` Johannes Schindelin
2023-09-22 10:42 ` [PATCH 3/6] coverity: allow overriding the Coverity project Johannes Schindelin via GitGitGadget
2023-09-23  7:00   ` Jeff King
2023-09-25 11:52     ` Johannes Schindelin
2023-09-25 12:11       ` Jeff King
2023-09-26 14:02         ` Johannes Schindelin
2023-09-26 14:19           ` Junio C Hamano
2023-09-26 14:39             ` Jeff King
2023-09-26 16:50               ` Junio C Hamano
2023-09-26 14:45           ` Jeff King
2023-09-22 10:42 ` [PATCH 4/6] coverity: support building on Windows Johannes Schindelin via GitGitGadget
2023-09-23  7:03   ` Jeff King
2023-09-22 10:42 ` Johannes Schindelin via GitGitGadget [this message]
2023-09-23  7:06   ` [PATCH 5/6] coverity: allow running on macOS Jeff King
2023-09-25 11:52     ` Johannes Schindelin
2023-09-25 12:13       ` Jeff King
2023-09-22 10:42 ` [PATCH 6/6] coverity: detect and report when the token or project is incorrect Johannes Schindelin via GitGitGadget
2023-09-23  7:07   ` Jeff King
2023-09-25 11:52     ` Johannes Schindelin
2023-09-25 12:17       ` Jeff King
2023-09-25 11:50 ` [PATCH v2 0/6] Add a GitHub workflow to submit builds to Coverity Scan Johannes Schindelin via GitGitGadget
2023-09-25 11:50   ` [PATCH v2 1/6] ci: add a GitHub workflow to submit Coverity scans Johannes Schindelin via GitGitGadget
2023-09-25 11:50   ` [PATCH v2 2/6] coverity: cache the Coverity Build Tool Johannes Schindelin via GitGitGadget
2023-09-25 11:50   ` [PATCH v2 3/6] coverity: allow overriding the Coverity project Johannes Schindelin via GitGitGadget
2023-09-25 11:51   ` [PATCH v2 4/6] coverity: support building on Windows Johannes Schindelin via GitGitGadget
2023-09-25 11:51   ` [PATCH v2 5/6] coverity: allow running on macOS Johannes Schindelin via GitGitGadget
2023-09-25 11:51   ` [PATCH v2 6/6] coverity: detect and report when the token or project is incorrect Johannes Schindelin via GitGitGadget
2023-09-25 12:25   ` [PATCH v2 0/6] Add a GitHub workflow to submit builds to Coverity Scan Jeff King
2023-09-25 17:20   ` Junio C Hamano
2023-09-26 13:57     ` Johannes Schindelin

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=782cf2b440313fcad0492ee352fa66d1a3534ac4.1695379323.git.gitgitgadget@gmail.com \
    --to=gitgitgadget@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=johannes.schindelin@gmx.de \
    /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).