---
coverity:
  image: registry.gitlab.inria.fr/solverstack/docker/distrib
  stage: analyse
  tags: ["linux"]
  dependencies: []
  artifacts:
    name: chameleon_coverity
    expire_in: 1 week
    paths:
      - chameleon.tgz
  variables:
    VERSION: coverity
  script:
    - (cd build-$VERSION &&
       cmake .. -C ../cmake_modules/gitlab-ci-initial-cache.cmake
                -DCHAMELEON_USE_CUDA=ON -DCHAMELEON_USE_MPI=ON &&
       cov-build --dir ../cov-int make -j 4)
    - tar czvf chameleon.tgz cov-int
    - curl --form token=$COVERITY_TOKEN
           --form email=florent.pruvost@inria.fr
           --form file=@chameleon.tgz
           --form version="`git rev-parse --short HEAD`"
           --form description=""
           https://scan.coverity.com/builds?project=Chameleon
  only:
    - master@solverstack/chameleon
  except:
    - schedules
