name: Coverity Scan

on:
  schedule:
    - cron: 0 8 * * MON
  workflow_dispatch:

jobs:
  coverity:
    if: github.repository_owner == 'varnishcache'
    runs-on: ubuntu-latest
    steps:
      - run: |
          sudo apt-get install -y \
            autoconf \
            automake \
            build-essential \
            ca-certificates \
            cpio \
            libedit-dev \
            libjemalloc-dev \
            libncurses-dev \
            libpcre2-dev \
            libtool \
            libunwind-dev \
            pkg-config \
            python3-sphinx
      - uses: actions/checkout@v2
      - run: ./autogen.sh
      - run: ./configure --with-persistent-storage
      - uses: vapier/coverity-scan-action@v0
        with:
          project: varnish
          email: varnish-dev@varnish-cache.org
          token: ${{ secrets.COVERITY_SCAN_TOKEN }}
