
name: Coverity
on:
  schedule:
    - cron: '0 5 * * *' # Daily at 05:00 UTC

jobs:
  coverity:
    name: "Test Suite"
    runs-on: ubuntu-20.04
    defaults:
      run:
        working-directory: cockpit-composer
    steps:
      - name: Clone repository
        uses: actions/checkout@v2
        with:
         path: cockpit-composer

      - name: Install Dependencies
        run: |
          sudo apt update
          sudo apt install nodejs npm

      - name: Download Coverity Tool
        run: |
          make coverity-download
        env:
         COVERITY_TOKEN: ${{ secrets.COVERITY_TOKEN }}

      - name: Coverity check
        run: |
          make coverity-check
          
      - name: Upload analysis results
        run: |
          make coverity-submit
        env:
         COVERITY_TOKEN: ${{ secrets.COVERITY_TOKEN }}
         COVERITY_EMAIL: ${{ secrets.COVERITY_EMAIL }}
