travis-coverity.sh 1.3 KB

1234567891011121314151617181920212223242526272829303132333435
  1. #! /bin/sh
  2. #
  3. # Travis CI script for weekly (cron) use:
  4. # - use the coverity tool to build and and upload results
  5. #
  6. test -n "$COVERITY_SCAN_TOKEN" || { echo "! Missing Coverity token" ; exit 1 ; }
  7. test -n "$BUILDDIR" || { echo "! \$BUILDDIR not set" ; exit 1 ; }
  8. test -n "$SRCDIR" || { echo "! \$SRCDIR not set" ; exit 1 ; }
  9. test -d $BUILDDIR || { echo "! $BUILDDIR not a directory" ; exit 1 ; }
  10. test -d $SRCDIR || { echo "! $SRCDIR not a directory" ; exit 1 ; }
  11. test -f $SRCDIR/CMakeLists.txt || { echo "! Missing $SRCDIR/CMakeLists.txt" ; exit 1 ; }
  12. cd $BUILDDIR || exit 1
  13. curl -k -o coverity_tool.tar.gz \
  14. -d "token=$COVERITY_SCAN_TOKEN&project=calamares%2Fcalamares" \
  15. https://scan.coverity.com/download/cxx/linux64 || exit 1
  16. mkdir "$BUILDDIR/coveritytool"
  17. tar xvf coverity_tool.tar.gz -C "$BUILDDIR/coveritytool" --strip-components 2
  18. export PATH="$BUILDDIR/coveritytool/bin:$PATH"
  19. echo "# cmake -DCMAKE_BUILD_TYPE=Debug $CMAKE_ARGS $SRCDIR"
  20. cmake -DCMAKE_BUILD_TYPE=Debug $CMAKE_ARGS $SRCDIR || exit 1
  21. cov-build --dir cov-int make -j2
  22. tar caf calamares-ci.tar.xz cov-int
  23. curl -k --form token=$COVERITY_SCAN_TOKEN \
  24. --form email=groot@kde.org \
  25. --form file=@calamares-ci.tar.xz \
  26. --form version="master-`date -u +%Y%m%d`" \
  27. --form description="master on `date -u`" \
  28. https://scan.coverity.com/builds?project=calamares%2Fcalamares