# Rules for where jobs can run

.run_automatically:
    rules:
        - if: '$CI_MERGE_REQUEST_ID'
          when: on_success
        - if: '$CI_PROJECT_PATH == "paraview/paraview"'
          when: on_success
        - when: never

.run_scheduled:
    rules:
# uncomment these lines manually if you want to test a scheduled builder
# manually for MRs. disabling these to make it easier to do tests on MRs
#        - if: '$CI_MERGE_REQUEST_ID'
#          when: manual
        - if: '$CI_PIPELINE_SOURCE == "schedule" && $CI_PROJECT_PATH == "paraview/paraview"'
          when: on_success
        - when: never

.run_manually:
    rules:
        - if: '$CI_MERGE_REQUEST_ID'
          when: manual
        - if: '$CI_PROJECT_PATH == "paraview/paraview"'
          when: delayed
          start_in: 30 minutes
        - when: never

.merged_only:
    rules:
        - if: '$CI_MERGE_REQUEST_ID'
          when: never
        - if: '$CI_PROJECT_PATH == "paraview/paraview"'
          when: on_success
        - when: never

.run_superbuild_trigger:
    rules:
        - if: '$CI_MERGE_REQUEST_ID'
          when: never
        - if: '$CI_BRANCH_NAME == "nightly-master"'
          when: never
        - if: '$CI_PROJECT_PATH == "paraview/paraview"'
          when: on_success
        - when: never

.upload_only:
    rules:
      - if: '$RSYNC_UPLOAD_ENABLE == "true"'
        when: on_success
      - when: never

.doxygen_only:
    rules:
        - if: '$CI_MERGE_REQUEST_ID'
          when: manual
        - if: '$CI_PIPELINE_SOURCE == "schedule" && $CI_PROJECT_PATH == "paraview/paraview"'
          when: on_success
        - if: '$CI_COMMIT_TAG && $CI_PROJECT_PATH == "paraview/paraview"'
          when: on_success
        - when: never
