From b2df20e39fb21beabdd976a2a22849a1d4e95949 Mon Sep 17 00:00:00 2001 From: Jiri Danek Date: Mon, 25 Dec 2017 00:05:16 +0100 Subject: [PATCH] NO-JIRA branch for automated periodic Coverity Scan runs This commit could be added as a new branch. Then, TravisCI can be set up to build it daily (or weekly). What it does is that it 1) checks out the current master branch 2) builds it under the Coverity tool 2) submits the build to Coverity Scan The `COVERITY_SCAN_TOKEN` would need to be replaced with a correct one. --- .travis.yml | 53 +++++++++++++++++++++++++++++++++++++++++++ build_for_analysis.sh | 29 +++++++++++++++++++++++ prepare_for_build.sh | 27 ++++++++++++++++++++++ 3 files changed, 109 insertions(+) create mode 100644 .travis.yml create mode 100755 build_for_analysis.sh create mode 100755 prepare_for_build.sh diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000000..6015089d58 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,53 @@ +os: linux +dist: trusty +sudo: false +language: +- c +- cpp +compiler: +- gcc +addons: + apt: + packages: + - cmake + - libssl-dev + - libsasl2-dev + - sasl2-bin + - swig + - python-dev + - valgrind + - ruby + - ruby-dev + - python3-dev + - php5 + - golang + - lcov + +env: + global: + # COVERITY_SCAN_TOKEN + - secure: "KuTcw3SrSjtap+3eZJqwMuPHKHqEgguk905EifiUQSHNHoLxmGk9SwCwy5ujIcdrPze2w18KF2Nfcqu213o7pK+5FHcFc4A61JkBw+TOYHYiP9GmuINlTg5Vp/tPoISRKdLUiJ1ZCstcmUAJ/+u3x0WqzlZ3qvWa7YCBruUprjNK2KaNqinNKOib8/vtyPP3MfcaQiG7LqG7PUGER0aVyMX/TjsBAG2ShiIB2ir3yFkshEw/eNRP9hVsHz7JmA18mHOmbTYPZ+TE3+snc1ocEcX/YwmNvq2dlu51XUlxE0hatF5Vt4D1BRd/pT4Y6cyJ3+HXTG5+l8LeTI5oGk7Msfhew/YCSlkygciwdzbwSJtNrtMNVkIh9WW3qDjAZyXKPpVIOwPZH+hARM/pPWGa/JtmOi8d8T/vr6OXjwuvtrvPssbauxbaOTe7q5whWrAH9gNoeUuGbz6JpvWwxVJwJ4f3Wj5aLmO3Fv4tAT3gQHjkKEE2RYg1PRySNI/qkEwuF0CFuVDEbb8dKBUoYQISCIbcoBjiC5rimt6hVmRbfvtBym2Dmwir4x3m00GvessUWShGe7Ai0SQdOAhJZTqXJyyqySEwLx8SJSiOP8j9VWOCcfSTMzBWQ4H/YjhUxOUkkyo3M9Q4XtOL15/0kemklts2qV/ztcI9+o8zupaZ0Tw=" + +addons: + # https://scan.coverity.com/travis_ci + coverity_scan: + project: + name: cli-java + version: SNAPSHOT + description: cli-java is a collection of commandline messaging clients suitable for interacting with Message Oriented Middleware such as ActiveMQ Artemis broker or Qpid Dispatch router. + + notification_email: jdanek@redhat.com + + # Commands to prepare for build_command + build_command_prepend: ./prepare_for_build.sh + + # The command that will be added as an argument to "cov-build" to compile your project for analysis, + build_command: --fs-capture-search ./ ./build_for_analysis.sh + + # Pattern to match selecting branches that will run analysis. We recommend leaving this set to 'coverity_scan'. + # Take care in resource usage, and consider the build frequency allowances per + # https://scan.coverity.com/faq#frequency + branch_pattern: .* + +# skip default build steps +script: [] diff --git a/build_for_analysis.sh b/build_for_analysis.sh new file mode 100755 index 0000000000..e8ece03c3e --- /dev/null +++ b/build_for_analysis.sh @@ -0,0 +1,29 @@ +#!/usr/bin/env bash + +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + +# build_for_analysis.sh builds everything that should be analyzed + +cd qpid-proton/build + +# https://scan.coverity.com/download?tab=cxx +# https://scan.coverity.com/download?tab=other +cmake .. -DCMAKE_INSTALL_PREFIX=$PWD/install +cmake --build . --target install diff --git a/prepare_for_build.sh b/prepare_for_build.sh new file mode 100755 index 0000000000..bfeccf72ce --- /dev/null +++ b/prepare_for_build.sh @@ -0,0 +1,27 @@ +#!/usr/bin/env bash + +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + +# prepare_for_build.sh clones the relevant repository + +git clone git://git.apache.org/qpid-proton.git + +cd qpid-proton +mkdir build