jrl-umi3218 / jrl-travis

Travis build scripts
Other
7 stars 10 forks source link

Coverity: new Travis CI integration guidelines #15

Closed bchretien closed 9 years ago

bchretien commented 9 years ago

Apparently, there is now limits on the number of coverity checks per day/week:

  • Up to 12 builds per week, with a maximum of 3 builds per day, for projects with fewer than 100K lines of code
  • Up to 8 builds per week, with a maximum of 2 builds per day, for projects with 100K to 500K lines of code
  • Up to 4 builds per week, with a maximum of 1 build per day, for projects with 500K to 1 million lines of code
  • Up to 2 builds per week, with a maximum of 1 build per day, for projects with more than 1 million lines of code

It is suggested to create a coverity_scan branch, and only run the analysis every now and then:

Note: Coverity Scan's analysis should be run regularly to maintain your code quality, but not on each and every commit and branch. We recommend you use a branch named coverity_scan, and push single commits to it when you'd like to trigger analysis. Click here to read about build frequency allowances.

As for the Travis CI integration, I guess we need to remove the support from jrl-travis and follow the guidelines. We should probably check whether the current build is a coverity scan and process accordingly, since it may fail because of the scan frequency restriction.

env:
  global:
    # COVERITY_SCAN_TOKEN
    # ** specific to your project **
    - secure: "xxxx"

addons:
  coverity_scan:

    # GitHub project metadata
    # ** specific to your project **
    project:
      name: my_github/my_project
      version: 1.0
      description: My Project

    # Where email notification of build analysis results will be sent
    notification_email: scan_notifications@example.com

    # Commands to prepare for build_command
    # ** likely specific to your build **
    build_command_prepend: ./configure

    # The command that will be added as an argument to "cov-build" to compile your project for analysis,
    # ** likely specific to your build **
    build_command: make

    # 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: coverity_scan
bchretien commented 9 years ago

For those interested, this can be achieved like this when using the jrl-cmakemodules (here for roboptim-core):

addons:
  coverity_scan:
    project:
      name: "roboptim/roboptim-core"
      description: "Build submitted via Travis CI"
    notification_email: roboptim@googlegroups.com
    build_command_prepend: ". .travis/common.sh && mkdir coverity && cd coverity && cmake .."
    build_command: "make"
    branch_pattern: coverity_scan

The script entry should also be updated:

  - if [ "${COVERITY_SCAN_BRANCH}" != "1" ]; then ./.travis/run build; fi

(note that ${COVERITY_SCAN_BRANCH} may not exist on forks)

olivier-stasse commented 9 years ago

Thanks a lot Benjamin. It is very useful as usual.