name: coverity-scan

# Controls when the action will run. 
on:
  # Run this action on a schedule (we're allowed a maximum of two per day)
  schedule:
    - cron: '0 18 * * SUN' # Sunday at 18:00 UTC

  # Allows you to run this workflow manually from the Actions tab
  workflow_dispatch:

concurrency:
  group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
  cancel-in-progress: true

permissions:
  contents: read

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
  build:
    runs-on: ubuntu-latest
    if: github.repository == 'MapServer/MapServer'
    steps:
      - uses: actions/checkout@v5

      - name: Build
        run: |
            docker run \
            -e WORK_DIR="$PWD" \
            -e TOKEN="${{ secrets.COVERITY_SCAN_TOKEN }}" \
            -v $PWD:$PWD ubuntu:24.04 $PWD/scripts/coverity-scan.sh

