
name: pmemkv-coverity
on:
  schedule:
    # run this job at 00:00 UTC everyday
    - cron:  '0 0 * * *'

env:
  REPO:           pmemkv
  GITHUB_REPO:    pmem/pmemkv
  CONTAINER_REG:  ghcr.io/pmem/pmemkv
  HOST_WORKDIR:   ${{ github.workspace }}
  WORKDIR:        utils/docker
  IMG_VER:        latest
  COVERITY_SCAN_NOTIFICATION_EMAIL:  ${{ secrets.COVERITY_SCAN_NOTIFICATION_EMAIL }}
  COVERITY_SCAN_TOKEN:               ${{ secrets.COVERITY_SCAN_TOKEN }}

jobs:
  linux:
    name: Linux-coverity
    runs-on: ubuntu-latest
    strategy:
      matrix:
        CONFIG: ["TYPE=coverity OS=ubuntu OS_VER=20.04"]
    steps:
      - name: Clone the git repo
        uses: actions/checkout@v2

      # coverity workflow should just reuse (pull) the most recent, available image
      - name: Pull the image
        run: cd $WORKDIR && ${{ matrix.CONFIG }} ./pull-or-rebuild-image.sh pull

      - name: Run the build
        run: cd $WORKDIR && ${{ matrix.CONFIG }} ./build.sh
