]> The Tcpdump Group git mirrors - tcpdump/commitdiff
CI: Switch Coverity Scan from Travis to Cirrus. [skip appveyor]
authorDenis Ovsienko <[email protected]>
Wed, 3 Mar 2021 01:57:13 +0000 (01:57 +0000)
committerDenis Ovsienko <[email protected]>
Wed, 3 Mar 2021 02:17:00 +0000 (02:17 +0000)
.cirrus.yml
.travis.yml

index 1188ac55a2f4f51872847ca11363e1b46ff953fc..de8be9ac64007e0b5f8ffbf25bda23d3e3cb425b 100644 (file)
@@ -4,6 +4,7 @@ env:
 
 freebsd_task:
   name: FBSD+BM
+  only_if: $CIRRUS_BRANCH == master || $CIRRUS_BRANCH == tcpdump-4.99
   freebsd_instance:
     # FreeBSD fails to start with 1 GB. 8 CPUs max concurrency.
     matrix:
@@ -31,6 +32,7 @@ freebsd_task:
 
 linux_task:
   name: LNX+BM
+  only_if: $CIRRUS_BRANCH == master || $CIRRUS_BRANCH == tcpdump-4.99
   container:
     # Linux works just fine with 1 GB. 16 CPUs max concurrency.
     cpu: 4
@@ -53,6 +55,7 @@ linux_task:
 
 macos_task:
   name: MAC+BM
+  only_if: $CIRRUS_BRANCH == master || $CIRRUS_BRANCH == tcpdump-4.99
   macos_instance:
     image: big-sur-xcode
     # "cpu" and "memory" are invalid keywords for macOS tasks now
@@ -64,3 +67,28 @@ macos_task:
     - brew install libsmi | grep -v '%'
     - (cd .. && echo '$ git clone [...] libpcap.git' && git clone --depth ${CIRRUS_CLONE_DEPTH} --branch=master --quiet ${LIBPCAP_GIT})
     - ./build_matrix.sh
+
+coverity_task:
+  name: Coverity Scan
+  only_if: $CIRRUS_BRANCH == coverity_scan
+  container:
+    cpu: 4
+    memory: 2G
+    image: ubuntu:20.04
+  env:
+    DEBIAN_FRONTEND: noninteractive
+    MAKEFLAGS: -j 5
+    COVERITY_SCAN_PROJECT_NAME: $CIRRUS_REPO_FULL_NAME
+    COVERITY_SCAN_TOKEN: ENCRYPTED[1b6f994cabfe74267ce2dce81fd9e49f694e9cfe69fb99f7d1580907bec1266efd7b38df3a47ccab53d5af98636f8e9c]
+    COVERITY_SCAN_BUILD_COMMAND_PREPEND: ./configure
+    COVERITY_SCAN_BUILD_COMMAND: make
+    COVERITY_SCAN_BRANCH_PATTERN: $CIRRUS_BRANCH
+    TRAVIS_BRANCH: $CIRRUS_BRANCH
+    TRAVIS_PULL_REQUEST: ${CIRRUS_BASE_BRANCH:+true}
+  script:
+    - apt-get -qy update
+    - apt-get -qy install autoconf make gcc
+    - apt-get -qy install libssl-dev libsmi2-dev libcap-ng-dev libpcap-dev
+    - apt-get -qy install git curl wget ruby rubygems ruby-json # for the coverity script
+    - apt list --installed 'lib*-dev'
+    - /bin/bash .travis-coverity-scan-build.sh # Not executable, depends on bashisms.
index eeccec484f60ad9ff7731255280d8f669b0179d3..1634ba3b69bd347deea06721dc48f026cb5ece22 100644 (file)
@@ -50,18 +50,15 @@ dist: focal
 jobs:
   fast_finish: true
   include:
-  - name: "amd64"
-    arch: amd64
-    if: branch = coverity_scan
   - name: "arm64"
     arch: arm64
-    if: branch != coverity_scan
+    if: branch IN (master, tcpdump-4.99)
   - name: "ppc64le"
     arch: ppc64le
-    if: branch != coverity_scan
+    if: branch IN (master, tcpdump-4.99)
   - name: "s390x"
     arch: s390x
-    if: branch != coverity_scan
+    if: branch IN (master, tcpdump-4.99)
   allow_failures:
     - arch: ppc64le # Since 20 Feb 2021 often times out trying to boot.
 
@@ -69,35 +66,9 @@ cache: ccache
 
 env:
   global:
-    # encrypted COVERITY_SCAN_TOKEN from
-    # https://scan.coverity.com/projects/<project_id>/submit_build?tab=travis_ci
-    - secure: "DwUeukcRGl1vXNZDDt2237zCA58ZzmzWpCkPcb/Hpeh8OvRw1eBZJiu4L8iD2qtY4A/dPDvOeBiml5MF6bVri9Dui1yPkvkvFqIXzbK5CWS6Ye+NgSBNMwqnAjhTMv/x8I4Bvy9IhDGwj/2JXVUvjBddRMLRyr/ag+MDRB1IVAI="
-    # Coverity run condition (avoid matrix multiple runs), need customized
-    # build script. Need an update if new matrix cases.
-    - coverity_scan_run_condition='"$TRAVIS_CPU_ARCH" = amd64 -a "$TRAVIS_OS_NAME" = linux -a "$CC" = gcc'
-    # Coverity script test mode (if true no uploading, avoid reaching the quota)
-    # usual processing: false.
-    - coverity_scan_script_test_mode=false
     - MAKEFLAGS='-j 2' # Travis CI VMs come with 2 cores
 
 addons:
-  coverity_scan:
-    # customized build script URL
-    # TRAVIS_REPO_SLUG: owner_name/repo_name of repository currently being built
-    # TRAVIS_BRANCH: name of the branch currently being built
-    build_script_url: https://raw.githubusercontent.com/$TRAVIS_REPO_SLUG/$TRAVIS_BRANCH/.travis-coverity-scan-build.sh
-    # project metadata
-    project:
-      name: $TRAVIS_REPO_SLUG
-    # Where email notification of build analysis results will be sent
-    #notification_email: [email protected]
-    # Commands to prepare for build_command
-    build_command_prepend: ./configure
-    # This command will be added as an argument to "cov-build" to compile
-    # the project for analysis
-    build_command: make
-    # Pattern to match selecting branches that will run analysis
-    branch_pattern: coverity_scan
   apt:
     packages:
       - libdbus-1-dev
@@ -123,8 +94,4 @@ before_script:
   - (cd .. && echo '$ git clone [...] libpcap.git' && git clone --depth 3 --branch=master --quiet git://github.com/the-tcpdump-group/libpcap.git)
 
 script:
-  # On the other hand, using travis_terminate on macOS appears to
-  # *cause* the problem, so we do so only on Linux.
-  #
-  - if [ "$COVERITY_SCAN_BRANCH" = 1 ]; then if [ "$TRAVIS_OS_NAME" = linux ]; then travis_terminate 0; else exit 0; fi; fi
   - ./build_matrix.sh