I want to automate student assignment grading system as much as possible. Ideally these steps will be taken when submitting the assignment.
I've successfully set Travis builds for every pull request in my repo. I have successfully run Coverity scan via Travis for every commit on my repo. But I can't trigger Coverity scans for pull request, only Travis builds are run. Can I fix this problem and maintain Coverity scan report for every pull request?
This is my .travis.yml
language: c
compiler: gcc
env:
global:
# The next declaration is the encrypted COVERITY_SCAN_TOKEN, created
# via the "travis encrypt" command using the project repo's public key
- secure: "WHkT1bLbpz8VA8tl+qyZvWHLg7YvnMPhCNXCEAQQaklcDq8HQ7glIrrs35VnTDfs09tVgkPbgsAfwBuwxqkmmxWaquW0AHdb6cefNpQVj2ovUriQVNBFmjfte9Bbq0NWKoLp+4IY/3IDfLoUOekOIDXuQtkJhNvX1zkkt21lSeo="
addons:
coverity_scan:
project:
name: "Freeuni-CN101-2014/midterm"
description: "Build submitted via Travis CI"
notification_email: [email protected]
build_command_prepend: ""
build_command: "make"
branch_pattern: "*"
script: make
Travis output of pull request here
Travis output after I merged the pull request with the main branch here
I asked Coverity support and they replied
The trigger for Coverity Scan happens for the specific branch and not for the pull request, and specially the branch that is mentioned in .travis.yml
With user @Admaster's help I started playing with Jenkins and cppcheck plugin. Jenkins is scanning pull requests successfully without setting build status to Github commits(Travis does set).
Example
So I continued experimenting with Travis and came over this repo. I changed my .travis.yml
file that looks like this
language: c
compiler: gcc
before_install:
- sudo apt-get install -qq cppcheck
script:
- cppcheck --error-exitcode=1 --quiet .
- make
cppcheck may be less effective then Coverity, but it's sufficient for students' assignments.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With